The password is stored at the address

/usr/local/vesta/conf/mysql.conf

To find out login and password from root access to MySQL you need to connect to the server via SSH, and open the file using a text editor, for example Nano:

nano /usr/local/vesta/conf/mysql.conf  

file

It would look like this:

file

Changing the MySQL user password in VestaCP

Use this command to change the password:*

mysqladmin -u root -pOLDPASSWORD password 'NEWPASSWORD'  
  • OLDPASSWORD specify the real mysql root password you get from the mysql.conf file
  • Replace NEWPASSWORD with the new password you want.

After that, try to return to the mysql server with root privileges, using the new password you just created:


mysql -u root -pNEWPASSWORD  

Open the mysql.conf file again and replace the old password (the one created by Vesta) with the new password:

nano /usr/local/vesta/conf/mysql.conf  

Save your changes and exit the editor, in Nano (Ctrl+O, then Ctrl+X).

Then you need to change the old mysql password stored in my.cnf:*

nano /root/.my.cnf  

file

Save your changes and exit the editor, in Nano (Ctrl+O, then Ctrl+X).

You can now open PhpMyAdmin and log in.

Updated Dec. 28, 2018