show variables like "max_connections";This will return a resultset like this, showing you what your current max connections setting is:
+-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_connections | 100 | +-----------------+-------+
To update the max_connections setting in MySQL :-
You can change the setting to e.g. 200 or more that depend upon ur server RAM size by issuing the following command without having to restart the MySQL server (obviously it will only work if the user you are logged in as has sufficient permissions to do this) ,no need to restart server:
set global max_connections = 200;
This will take effect immediately, but will be forgotten the next time MySQL is restarted. To make the change permanent you need to edit the my.cnf configuration file. On CentOS, RedHat and similar distributions this is at /etc/my.cnf; other distros will store it elsewhere.
Under the [mysqld] section add the following setting:
max_connections = 200
Now when you restart MySQL the next time it will use this setting instead of the default.
Note that increasing the number of connections that can be made will increase the potential amount of RAM required for MySQL to run. Increase the max_connections setting with caution!