Reputation: 161
How i can change the variable max_connection to a higher value than 214. I try this on my.cnf but doesn't work
max_connections = 2000
The version of MySql is 5.6.24 and i already restarted the server.
Upvotes: 0
Views: 7806
Reputation: 11
You should also configure the open_files_limit and the table_open_cache , but be careful with open_files_limit_value not exceed the OS maximum.
cat /proc/ PID /limits | grep "open files"
In /etc/my.cnf configure the following
open_files_limit= 4096 #the maximum of the OS
max_connections = 500
table_open_cache = 600
restart mysql server using
service mysql restart
Upvotes: 1
Reputation: 11104
You can increase this value in main config file (e.g., /etc/my.cnf) using this syntax:
[mysqld]
set-variable=max_connections=250
If it not work
then either execute SET GLOBAL max_connections = 250;
in MySQL and restart MySQL.
NOTE:
You can find this error if your scripts open persistent connections, wich aren't closed even if the script terminates. Use mysql_connect() instead of mysql_pconnect() unless you have a good reason. In particular, check this setting in third-party scripts (such as osCommerce).
Server administrators can disable persistent connections for PHP scripts in php.ini file:
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent=Off
Scripts won't fail, they'll just use non-persistent connections silently.
Upvotes: 0