Increase MySQL Max Connections

To increase the maximum connections that mysql allows, you must edit the file /etc/my.cnf. Log into the server as root, and type this:

vi /etc/my.cnf 

There will be a section that looks like this: (may be slightly different)

[mysqld]
safe-show-database
innodb_data_file_path=ibdata1:10M:autoextend
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock 

Add the following line under [mysqld]

max_connections=250 

The resulting config file should resemble this:

[mysqld]
safe-show-database
innodb_data_file_path=ibdata1:10M:autoextend
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
max_connections=250 

You then save the changes, and type the following to restart mysqld:

/etc/init.d/mysqld restart 

You will see:

Stopping mysql: [ OK ]
Starting mysql: [ OK ] 

If Stopping FAILS, then you did something wrong. Try to backtrack and make sure you entered the new setting correctly.


'

 

'If you'd like to check to see if this setting was successfully applied, you may check using one of the following methods:

  1. login to mysql
    mysql -uadmin -p`cat /etc/psa/.psa.shadow` 
    and you will be at the "mysql>" prompt.
  2. Then give the command
    show variables like 'max_connections'; 
    make sure you put the semi-colon on the end. To exit mysql, use the "quit" command

Was this answer helpful?

 Print this Article

Also Read

Install SNMP (Centos)

Centos6yum -y install snmp Centos7yum install net-snmp net-snmp-utils rename the file:...

What can I use instead of TreeSize

There is a Windows program called Tree Size which shows disk usage. You can tell how much each...

How to change mail server ip address for qmail

1) first check the domain names which are configured on the server by viewing following file...

FTP uploads have wrong permissions

When files are created in a folder via FTP, the permisions are not set to those of the folder....

Setting pasv ports in PureFTP

  The PureFTP config file is here.... root@web-linux-cpanel [~]# grep -i passive...