Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In an attempt to tune MySQL to make it work with a recent installation of Drupal I had to modify the MySQL settings on my server. After modifying the configuration file for MySQL (/etc/my.cnf) MySQL stopped working. After some attempts I make it start again but now all my php/MySQL webistes are not being able to connect to their DBs.

Here is why is so confusing:

  • If I check a phpinfo.php on any given site, the MySQL info is there
  • phpmyadmin runs just fine
  • I can run mysql from SSH using root but I see that mysql activity is reduced, look:

[root@server mysql]# mysqladmin processlist

| Id  | User      | Host      | db        | Command        | Time | State              | Info             |
| 7   | eximstats | localhost | eximstats | Sleep          | 30   |                    |                  |
| 103 | DELAYED   | localhost | eximstats | Delayed insert | 30   | Waiting for INSERT |                  |
| 104 | DELAYED   | localhost | eximstats | Delayed insert | 149  | Waiting for INSERT |                  |
| 105 | DELAYED   | localhost | eximstats | Delayed insert | 149  | Waiting for INSERT |                  |
| 119 | root      | localhost |           | Query          | 0    |                    | show processlist |

My websites using MySQL almost all say:

Error establishing a database connection

Another say:

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'website_USER'@'localhost' (using password: NO)

This is my current my.cnf:

#bind-address =
log-bin = /var/lib/mysql/log-bin

max_allowed_packet = 64M

#port           = 3306



I commented most of it to return it to its simplest version... How can I make the web side to connect to mysql?


migration rejected from Jul 16 '14 at 15:58

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by Jack Douglas Jul 16 '14 at 15:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – Jack Douglas
If this question can be reworded to fit the rules in the help center, please edit the question.

After modifying the configuration file for MySQL (/etc/my.cnf) MySQL stopped working: Telling us something more about those modifications would certainly help us help you :) – Expert System May 13 '13 at 14:30
You're right! In a few words I re-vamped all the specs to higher amounts. When that didn't worked I started reducing specs until MySQL actually worked. Then, even when not reducing those specs MySQL wouldn't start, what I did was renaming the my.cnf to make it inexistent so when I started the mysql it create it one. – Escale May 13 '13 at 14:36
What versions of PHP and MySQL are you using ? Also, when you look at the output of phpinfo(), what is the "Client API Version" in the MySQL section ? – Expert System May 13 '13 at 15:24
PHP 5.2.9 Mysql Client API version 5.0.96 – Escale May 13 '13 at 15:38
Since all answers point to user authentication (and it is the problem), nothing in the question itself reveal that as the problem. It's as if the OP does not understand authentication as the real issue. This question should be closed as Too Localized. – RolandoMySQLDBA Jun 14 '14 at 21:04