Skip to main content

How to find out & Change VestaCP MySQL/MariaDB root Password ?

If you forget the MySQL/MariaDB root password, no worries to find out the mysql root password.
The password is stored at: /usr/local/vesta/conf/mysql.conf and /root/.my.cnf
Before do anything , create a backup file.
# cp /usr/local/vesta/conf/mysql.conf  /usr/local/vesta/conf/mysql.conf.bak
# cp /root/.my.cnf  /root/.my.cnf.bak
Use this syntax to change MySQL/MariaDB root password
# mysqladmin -u root -pOLDPASSWORD password 'NEWPASSWORD'
Change the root password
# mysqladmin -u root -pgX7wlY5V3F password 'gR7wlY6V9A' 
Now Update the newly changed password
# vi /usr/local/vesta/conf/mysql.conf
HOST='localhost' USER='root' PASSWORD='gR7wlY6V9A' CHARSETS='UTF8,LATIN1,WIN1250,WIN1251,WIN1252,WIN1256,WIN1258,KOI8' MAX_DB='500' U_SYS_USERS='admin,datahead' U_DB_BASES='3' SUSPENDED='no' TIME='15:10:16' DATE='2019-04-17'

# vi /root/.my.cnf
[client]
password='gR7wlY6V9A'

Comments