In this article we will go over how to edit the my.cnf file. There may be times that you need to edit your mysql configuration settings, and in order to do so you will need to edit the my.cnf. That file is found in the /etc directory.
You can run the command cat /etc/my.cnf to view the contents of the file. Feel free to learn more regarding the cat command.
The most common reason people edit their my.cnf file is to increase the max_user_connections line. By default it is set to 50, which is quite a bit, however at times you may need to increase that.
One very important note, ALWAYS make a copy of the file you are going to edit be fore you edit it.
Use the cp command: cp /etc/my.cnf /etc/my.cnf.backup
then press i to insert
edit the value you want to change, ie max_user_connections
then enter :wq (the w saves and the q quits)
Now the my.cnf has been edited.