[Quick Tip] How to Find Out Vesta CP MySQL Root Password

Tuesday, June 30th 2015. | how to

#howto ,#tutorial #VPS – [Quick Tip] How to Find Out Vesta CP MySQL Root Password – This tutorial explains step by step guide (with pics) about [Quick Tip] How to Find Out Vesta CP MySQL Root Password

mysql-root-feat

This is how you can find out default VestaCP MySQL root password and how the correct safe way to change it – The password is generated randomly and stored at mysql.conf file. As you may already knew it that Vesta CP is by default not directly show you Mysql root password right after the installation. So many users are still confused when they are in need to login to mysql server as root.

What’s your VestaCP MySQL root password?

The password is stored at:
/usr/local/vesta/conf/mysql.conf

So to find out what’s the password you can simply open up that file using your favorite text editor like Nano or vi:

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

It will appear like this:

mysql-vesta-password

the password is the one shown in PASSWORD=’randompassword. Note down that password or copy-paste it to Notepad.

Changing MySQL root password in VestaCP

Basically you can simply use usual way when you need too change mysql root password but that’s not the case with Vesta CP. There are another files you have to alter so Vesta CP can still run properly after password changing. Here’s how:

Step 1 – Use this usual mysql command to change password:

mysqladmin -u root -pOLDPASSWORD password 'NEWPASSWORD'

Replace OLDPASSWORD with the real mysql root password you get from mysql.conf file above. Also replace NEWPASSWORD with the new password you wish, just make sure you can remember it or noted in down.

Step 2 – Once done, try login back to mysql server as root using the new password you’ve just defined:

mysql -u root -pNEWPASSWORD

Step 3 – Open up mysql.conf file once again and replace your old password (the one generated by Vesta) with your new password:

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

Save changes and exit the editor which in Nano it is Control+O then Control+X.

Step 4 – Next, you have to change old mysql password stored in my.cnf:

nano /root/.my.cnf

my-cnf-password

replace that with the one you defined in step 1.

That’s all. You can now open PhpMyAdmin and login as root with password you’ve just created. Do not also forget to give it a test by creating new database via Vesta CP interface. I’m sure at some point you may need to know or change default Vesta CP mysql root password like what I did during Mysql Master – Slave replication setup. Subscribe to Servermom’s feed or follow me on Twitter to get faster update.

This post [Quick Tip] How to Find Out Vesta CP MySQL Root Password is part of ServerMom.

Source link