Forgot the default root password of VestaCP MySQL?Set and modify the root password

Among the many control panels, manySEOPeople buy VPSBuilding website, prefer to use the Vesta CP control panel.

  • because VestaCP Control panel, basically all configuration files are stored in conf files.
  • LinuxDuring the process of installing VestaCP on the system, VestaCP will not ask for inputMySQLroot password.
  • The password is automatically generated by VestaCP.

we are logging inphpMyAdmin, how to find and modifyMySQL the default password?

The MySQL default password for VestaCP exists in /usr/local/vesta/conf/mysql.conf in the file.

SSH to view MySQL default password

You can enter the following command in SSH to view the default root password of MySQL ▼

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

Forgot the default root password of VestaCP MySQL?Set and modify the root password

Find the MySQL password, and record the location of the MySQL password file, you can log in to phpMyAdmin database management.

How to change the root password of MySQL?

Please see the following VestaCP CentOS How to change the MySQL root password.

Step 1:Log in to MySQL and enter the following command ▼

mysql -uroot -p
  • Enter the MySQL root password you viewed in step 1.
  • After successful login, make the modification.

Step 2:Change MySQL password 

set password for root@localhost = password('新密码');

Step 3:In the state of logging in to MySQL, refresh the permissions

mysql> flush privileges;

How to change root password without logging in to MySQL

mysqladmin -uroot -p旧密码 password 新密码

After modifying the root password with the above method, you must modify the password in the MySQL default file ▼

vi /usr/local/vesta/conf/mysql.conf
  • Change the previous password to your existing password.

If the password in the MySQL default file is not modified, "VestaCP Error: connection to localhost failed" error message...

For the solution, please refer to this tutorial▼

Extended reading:

Hope Chen Weiliang Blog ( https://www.chenweiliang.com/ ) shared "Forgot the default root password of VestaCP MySQL?Setting and Modifying the Root Password" will help you.

Welcome to share the link of this article:https://www.chenweiliang.com/cwl-706.html

Welcome to the Telegram channel of Chen Weiliang's blog to get the latest updates!

🔔 Be the first to get the valuable "ChatGPT Content Marketing AI Tool Usage Guide" in the channel top directory! 🌟
📚 This guide contains huge value, 🌟This is a rare opportunity, don’t miss it! ⏰⌛💨
Share and like if you like!
Your sharing and likes are our continuous motivation!

 

Comment

Your email address will not be published. Required fields * Callout

scroll to top