I am using MySQL server 5.0. I have a table named User_Login_Details. I want to receive email from my MySQL server when anyone tries to change anything in my Table. That may be Insert, Update or Delete.  How can I do this?
121690
I'm trying to send an email to several recipients when a new row is inserted into a table. The list of recipients varies.  I would like to be able to set this list using a select statement.  I also have installed Navicat which allows me to send email notifications but only to a predetermined set of people.  Thanks.
82000
I am trying to create the following trigger:      CREATE TRIGGER update_customers AFTER INSERT ON wp_usermeta     FOR EACH ROW      BEGIN             if new.wp_metakey = first_name then insert into test_customer(first_name) values (new.wp_meta_value);     END   I keep getting a 1064 error that says, "You have an error in your SQL syntax; check the manual that corresopons to your MySQL server version for the right syntaxt to use near " at line 5"  What am I doing wrong?
63922
I'd like to send my Drupal installation to a colleague, but I don't want him to see the username and the password of my database. Where are these informations stored?  I've seen that the username and the password are written in sitename/sites/default/settings.php, but is it the only file with these informations? Is it sufficient if I change the username and the password in this file and then send my colleague all my Drupal files and my database?
18273
I tried mysql in my command line :   I get:  The program 'mysql' is currently not installed.  You can install it by typing: sudo apt-get install mysql-client-core-5.5   But when I do:  sudo apt-get install mysql-client-core-5.5   But I get:  Reading package lists... Done Building dependency tree        Reading state information... Done mysql-client-core-5.5 is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 47 not upgraded.   How should I proceed?
73
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
122983
I use PHP 5.4.3 and I want to connect to a MySQL database (DB for brevity) remotely (the PHP script resides on a different server than the DB) with normal object-oriented programming (OOP) way:  $mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);   and I get the error:      Warning: mysqli::mysqli(): The server requested authentication method unknown to the client [mysql_old_password]   Connect Error (2054) The server requested authentication method unknown to the client   I found  and  but they don't seem to help. I used PHP 5.2.9 and everything worked OK, but downgrading the PHP version is not a solution for me.   I also have to mention that I don't have full access to DB's settings cause the client doesn't give me that kind of access. I told him to ask Hostgator for a newer password format support, but they answered that they cannot do anything which was not what I was expecting. I did a new effort from another remote server and I get now this:     Connect Error (1045) Access denied for user 'user'@'host' (using password: YES)   by using PHP 5.3.9. It looks like the DB doesn't "let me in" because of the remote server's PHP script, but with Oracle's Workbench everything works fine.  Thanks for your time.
22164
I just can't login to PhpMyAdmin anymore, it says bad logins. PHP works perfectly. Please help. Thank you.  2002 Cannot log in to the MySQL server Language Log in Username: Password:  Connection for controluser as defined in your configuration failed.
14000
I've been having trouble getting my server to send email and I haven't for the life of me figured out how to fix it. If anyone could give me some simple pointers, that would be muchly appreciated!  May 19 15:36:03 ubuntu-12 sm-mta[2484]: s4JFa3jp002484: from=&lt;www-data@ubuntu-12.04-     production&gt;, size=412, class=0, nrcpts=1, msgid=&lt;201405191535.s4JFZw4c002483@ubuntu-12.04-  production&gt;, proto=ESMTP, daemon=MTA-v4, relay=ip6-localhost [127.0.0.1] May 19 15:36:03 ubuntu-12 sendmail[2483]: s4JFZw4c002483: to=myname@mycompany.com, ctladdr=www-data (33/33), delay=00:00:05, xdelay=00:00:05, mailer=relay, pri=30123, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (s4JFa3jp002484 Message accepted for delivery) May 19 15:36:03 ubuntu-12 sm-mta[2487]: s4JFa3jp002484: to=&lt;myname@mycompany.com&gt;, ctladdr=&lt;www-data@ubuntu-12.04-production&gt; (33/33), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120412, relay=mailserver.mycompany.com. [213.171.216.115], dsn=5.0.0, stat=Service unavaila$ May 19 15:36:03 ubuntu-12 sm-mta[2487]: s4JFa3jp002484: s4JFa3jp002487: DSN: Service unavailable May 19 15:36:03 ubuntu-12 sm-mta[2487]: s4JFa3jp002487: to=&lt;www-data@ubuntu-12.04-production&gt;, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent
35802
When i run the following in my console:  [root@****~]# mysql -u root -p -e 'SELECT VERSION();' Enter password: +-----------+ | VERSION() | +-----------+ | 5.5.39    | +-----------+   Which should be the correct version.  However when i enter my PHPMYADMIN on my server it has the following specs:  Server: Localhost via UNIX socket Program: MySQL Programversion: 5.1.73 - Source distribution   So which version is the correct one and how do i make sure that the database is running on 5.5?  Note  I have already restarted sql several times without any changes
48061
How can ALTER be used to drop a column in a MySQL table if that column exists?   I know I can use ALTER TABLE my_table DROP COLUMN my_column, but that will throw an error if my_column does not exist. Is there alternative syntax for dropping the column conditionally?  I'm using MySQL version 4.0.18.
106060
I'm using the command:  echo "Test if email can be sent from server" | mail -s "Test" myaccount@gmail.com  This is on an Ubuntu Server 12.04 completely up to date.  To catch you up on my troubleshooting:  1) I have installed mailutils with the "Internet Site" option (or whatever that internet option was; I can't remember exactly what it was called off the top of my head).  2) I have added myself to the group 'mail'.  3) I have checked that my ISP does, in fact, block port 25. I followed  using port 587, which is unblocked (I'm not sure that this has an effect on outgoing mail; it looks like a mail server to me)  4) I've also tried echo "Test if email can be sent from server" | sendmail -f myaccount@gmail.com myaccount@gmail.com, but this also appears to do nothing.  5) I am worried that gmail is receiving on port 587, but that it doesn't know what to do with the traffic. Is this an unfounded consideration?  6) My gmail user name contains a '.' before the '@gmail.com'. Is it possible that this is confusing the mail and sendmail commands? (edit: after some more experimenting, this is probably not the problem)
44452
I am using MSSQL Server 2005. In my db, I have a table "customerNames" which has two columns "Id" and "Name" and approx. 1,000 results.   I am creating a functionality where I have to pick 5 customers randomly every time. Can anyone tell me how to create a query which will get random 5 rows (Id, and Name) every time  when query is executed?
101410
I recently installed MySQL 5 on Windows 2003 and tried configuring an instance. Everything worked fine until I got to "Applying Security settings", at which point it gave me the above error (Can't connect to MySQL server on 'localhost' (10061)).  I do have a port 3306 exception in my firewall for 'MySQL Server'.
110801
I have a CentOS 6.3 server. I would like to create an email address like, for example, list@myserver.com that will be a special kind of email that will trigger a script.   For example: suppose I mail list@myserver.com and the subject is an IP address. I want the server to receive that mail, extract that IP from the subject and append it to a file.  How is this done on Linux? Can you guys tell me how this can be done?
98560
I have setup a mysql server on unbuntu. The server hosts websites for my various clients. Hence, I want all of them(and any new clients) to have remote access to the mysql server. How do I configure mysql for the same?  I know about the GRANT ALL PRIVILEGES command, but that would require me to individually grant remote access to all the users.
45100
I have a simple mysql table which I use as a server booking system. A user can log in to a server, if he has a valid booking for that server. A sample data might look like this:  +----------+----------------+---------------------+---------------------+ | server   | user           | start               | end                 | +----------+----------------+---------------------+---------------------+ | server01 | Alice,Bob      | 2013-10-28 00:00:00 | 2013-12-31 00:00:00 | | server02 | Carlos         | 2013-10-28 00:00:00 | 2013-12-31 00:00:00 | | server03 | Dan,Erin,Frank | 2013-10-28 00:00:00 | 2013-12-31 00:00:00 | +----------+----------------+---------------------+---------------------+   To check whether user Carlos has a booking for server02, I use the following SQL query:  SELECT 0, id FROM booking WHERE user = 'Carlos' AND (( start &lt; now() and end &gt; now() ) AND server = 'server02') ;   But this query does not work if there are multiple (comma-separated) users. How can I check if Alice has booking for server01 ?
30257
I have a table:  table votes (     id,     user,     email,     address,     primary key(id), );   Now I want to make the columns user, email, address unique (together).  How do I do this in MySql?  Of course the example is just... an example. So please don't worry about the semantics.