Mysql does not execute or produce the warning message on the browser, Warning: mysql_connect() [function.mysql-connect]: Too many connections in ...
Checked in mysql error log file using tail command,
# tail -f /var/lib/mysql/host3domain.localdomain.err
140326 12:29:27 [ERROR] Error in accept: Too many open files
140326 12:33:43 [ERROR] Error in accept: Too many open files
140326 12:29:27 [ERROR] Error in accept: Too many open files
140326 12:33:43 [ERROR] Error in accept: Too many open files
Files open exceed the amount of file descriptors of the mysql server the default open_files_limit has set 1024,
# mysqladmin variables |grep -i open
| have_openssl | DISABLED
| innodb_open_files | 300
| open_files_limit | 1024
| table_open_cache | 400
| have_openssl | DISABLED
| innodb_open_files | 300
| open_files_limit | 1024
| table_open_cache | 400
It is potential to cause change in /etc/my.cnf. open the my.cnf file and increase the open_files_limit values.
# vi /var/my.cnf
[mysqld]
open_files_limit=5000
...
[mysqld]
open_files_limit=5000
...
Then restart the mysql,
#/etc/init.d/mysql restart
Now, check the open file limits for mysql,
# mysqladmin variables | grep -i open
| have_openssl | DISABLED
| innodb_open_files | 300
| open_files_limit | 5000
| table_open_cache | 400
| have_openssl | DISABLED
| innodb_open_files | 300
| open_files_limit | 5000
| table_open_cache | 400
OR
mysql> show global variables like 'open%';
+------------------+-----------+
| Variable_name | Value |
+------------------+-----------+
| open_files_limit | 5000 |
+------------------+-----------+
1 row in set (0.00 sec)
+------------------+-----------+
| Variable_name | Value |
+------------------+-----------+
| open_files_limit | 5000 |
+------------------+-----------+
1 row in set (0.00 sec)
Now, Mysql is running without any issue.
Comments (0)