Edit My.cnf file of Mysql on VPS server

kumkumsharma

Administrator
Staff member
My.cnf file located in /etc directory, but if you need to make any modification in Mysql then you can make changes in my.cnf file.

Let’s see how to make changes in my.cnf file:

You can check the content of my.cnf file with below command:

Code:
cat /etc/my.cnf
You can see the file now and here you will find the “#” in starting of many lines, it means these lines are commented.

You have open this file in text editor like nano with below command.

Code:
nano /etc/my.cnf
Here you can see various settings and you can change them according to your need.

For example if you want to increase max_connections from 20 to 30 then you can increase then by changing its number.

Code:
max_connections = 20
Now press Ctrl + O to save the settings and hit Ctrl + X to exit. Restart your Mysql server and you can check now your connections are updated.

Code:
service mysql restart
 
Top