How to edit the MySQL my.cnf file
Written by James RichardsonVPS and Dedicated server customers with root access can change their MySQL settings in the my.cnf file. To do this, you simply log in the server and edit the my.cnf file using Nano. This article will explain the steps to view and edit your my.cnf file.
How to view MySQL settings in the my.cnf file
- Login to your server via SSH
- To view the MySQL my.cnf settings type the following:
cat /etc/my.cnf
The contents of the my.cnf file will display similar to the snapshot to the right.
Editing the MySQL my.cnf file
- Login to your server via SSH
To edit the MySQL settings with nano type the following:
nano /etc/my.cnf
Note! There are several editors you can use in shell. Nano, Vim, or Emacs. This article will focus only on Nano.
Find the line to edit. For example, if you want to edit the max_connections, find the following line.
max_connections=100
To increase the max_connections to 110 change it to the following.max_connections=110
- Enter Ctrl + O to "WriteOut" or save the settings.
- Then Ctrl + X to exit.
- Restart MySQL by typing the following.
service mysql restart
Now the max_connections is increased to 110 instead of 100.
Viewing the MySQL variables through shell.
- Login to your server via SSH
Type the following command.
myasqladmin variables
The variables will display similar to the snapshot to the right.
Viewing MySQL variables in PhpMyAdmin
- Log into your phpMyAdmin
Click the Variables tab at the top right.
PhpMyAdmin will list all the variables and there settings on your server..
Like this Article?
Tweet
Latest Questions
If you need some help, submit your question to our Community!
We guarantee a response within 60 minutes (8am - 9pm EST, Monday - Friday)
Recent QuestionsNeed more Help?
Search
Ask the Community!
Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.
Current Customers
| Chat: | Click to Chat Now | E-mail: | support@InMotionHosting.com |
|---|---|---|---|
| Call: | 888-321-HOST (4678) | Ticket: | Submit a Support Ticket |

