How to get the MySQL root password details – cPanel

The MySQL server saves its root password in a file “.my.cnf” under the root directory. You can find out its from the file as I mentioned.


root@server [~]# cat /root/.my.cnf

If you were loged in to the server as root user, then you do not need the password to access the MySQL. You can simply access the Database by executing the command “mysql”.


root@server [~]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 275
Server version: 5.5.35-33.0 Percona Server (GPL), Release rel33.0, Revision 611
Copyright (c) 2009-2013 Percona LLC and/or its affiliates
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


  • 0 Users Found This Useful
Was this answer helpful?
Related Articles

Powered by WHMCompleteSolution

Copyright © 2020 Công ty TNHH KDATA. All Rights Reserved.