This is only a small tip for those use cPanel servers. If you are looking to find the MySQL root password for the server, it’s easy and can be done in a flah of a second. The password is saved in file named .my.cnf under the root directory of your server. Using the cat command, you can get the password from the file as follows.
Login to the server as root user and run the below mentioned command on it.
root@server [~]# cat /root/.my.cnf
You may be able to run the MySQL commands directly if you are logged in as the root user to the server.
The MySQL configuration file on a cPanel server is located in /etc/my.cnf, please do take backup of databases and config files before you make any changes to them. When the server load goes high and if you find the that the MySQL is the one that eats up the CPU, you can check which database is causing problems for your server. There is a linux command for it and the syntax is pasted below:
mysqladmin proc stat
In the output, check which database is making more queries, repair or optimize it to get the load issues fixed.
Thank you 🙂
- Load Average on Linux and Unix-like Systems Explained - May 16, 2020
- How to Install Webmin on CentOS/RHEL 7/6/5 – Linux - May 16, 2020
- List addon domains, parked domains and sub domains via command line – cPanel - May 13, 2020