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:
[mysqld]
#datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
#pid-file=/var/lib/mysql/mysqld.pid
#skip-bdb
#skip-innodb
#err-log=/var/log/mysql.log
#bind-address = server.escalehost.com
log-bin = /var/lib/mysql/log-bin
#innodb_buffer_pool_size=2M
#innodb_additional_mem_pool_size=500K
#innodb_log_buffer_size=500K
#innodb_thread_concurrency=2
#max_connections=125
#table_cache=2500
#thread_cache_size=100
#thread_stack=250K
#wait_timeout=10
#join_buffer=5M
#myisam_sort_buffer_size=15M
#query_cache_size=15M
#read_rnd_buffer_size=5M
max_allowed_packet = 64M
#open_files_limit=8602
#[client]
#port = 3306
#socket=/var/lib/mysql/mysql.sock
#[mysql.server]
#user=mysql
#basedir=/var/lib
[mysqld_safe]
#socket=/var/lib/mysql/mysql.sock
#err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
I commented most of it to return it to its simplest version... How can I make the web side to connect to mysql?
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 at 14:30