Well, there is a bug on VestaCP. When we install VestaCP using a custom password, it won’t change the MySQL root password. Instead, the MySQL server is installed through a default password. We have reported this to the vestaCP team but they didn’t resolve.
Right after the VestaCP is installed we try to log in to the PHPMyAdmin using user root and password it comes up with an error and we can’t log in. Moreover, there is no direct option in the admin interface from where we can change the PHPMyAdmin password. Most of us get quite nervous.
If you don’t know what is how to install VestaCP on Ubuntu 18.04 VPS then check it out here.
Here, we are going to discuss where the default VestaCP MySQL password is stored and how to change it.
For that, you need to have a root privileged SSH active connection.
Step 1. Login to your server
First of all, log in to your server using your favorite SSH client such as PuTTy using administrative privilege.
Step 2. Edit mysql.conf file
The password is stored inside the
mysql.conf file which is located at
/usr /local /vesta /conf/.
To edit or open this file, use the following command. Here you go –
Nano is a text editing CLI program just like notepad in windows. IF nano is not installed, you may install using the command
Sudo apt install nano. Otherwise, you may use other programs such as
Vim. The output of the above command is-
The default password “
abcdefghi” should be changed by your own VestaCP admin password.
Step 3. Edit .my.cnf file
The default password “
abcdefghi” is also stored inside
.my.cnf file located at /root/ To replace this password you need to perform the following command.
The output of this command is like the following image.
Change that default password too.
Step 4. Change VestaCP MySQL root password using CLI
The above steps are not sufficient to change MySQL password in Vestacp. It will not run the VestaCP properly. You need to alter another file so that it may run properly. For that use the following command.
mysqladmin -u root -pOLDPASSWORD password 'YOURNEWPASSWORD'
OLDPASSWORD is ‘
abcdefghi‘. Do not forget to replace the ‘
YOURNEWPASSWORD‘ by your own one.
If it has done successfully try to log in first using CLI to check whether it is correctly set or not.
mysql -u root
Enter your new password here and hit enter. If it successfully logged in then you are done.
Now you go to the Phpmyadmin page from VestaCP admin panel and try to log in using user
root and your newly created password.
If any further problem arises regarding PHPmyadmin or Mysql, you may check the following guide here.
I hope it would be helpful to you. If you have any suggestion leave a comment below. Thanks a lot.