DNSOnly mysql password
Is there any way to view the current MySQL password on cPanel DNSOnly installation? I can login to it using mysql command but want to view the current one. There is no way to change it via Web UI.
-
Hello, The MySQL root password is stored in the /root/.my.cnf file by default. Thank you. 0 -
Hello, The MySQL root password is stored in the /root/.my.cnf file by default. Thank you.
On cPanel installation - yes, but on cPanel DNSOnly - there is no such file.0 -
Hello, Is it possible it exists at another location? You can try finding it with a command such as: find / -name ".my.cnf"
If it doesn't exist, you can manually create this file in the /root directory with root ownership and 0600 permissions. Then, ensure the contents look like this:[client] password=MySQLRootPasswordHere user=root
Once this file is setup, you can follow the instructions to reset the MySQL root password from the top answer on a third-party URL like this: Change mysql root password on Centos7 Thank you.0 -
Hello @ronaldst, Could you open a support ticket using the link in my signature so we can take a closer look? Thank you. 0 -
I found another source of information and this lead me to a working solution. The easiest way to do this: 1. edit /etc/my.cnf, add the following [mysqld] skip-grant-tables
2. restart mysqlservice mysql restart
3. Run the followingmysql -u root use mysql UPDATE mysql.user SET Password=PASSWORD('YourPassword') WHERE USER='root' AND Host='localhost'; FLUSH PRIVILEGES; quit
4. edit /etc/my.cnf and remove the variable added in step 1 (skip-grant-tables) 5. restart mysqlservice mysql restart
6. test login with new passwordmysql -u root -h localhost -p Password
7. Create a /root/.my.cnf[client] password=YourPassword user=root
8. Change file permissions of .my.cnfchmod 0600 .my.cnf
8. Test .my.cnf by logging into MySQL againmysql -u root
This worked for me running MySQL 5.6. on cPanel DNSOnly server.0
Please sign in to leave a comment.
Comments
6 comments