How can I find out Mysql root password?

laurence

Member
Registered
Joined
Feb 7, 2015
Messages
39
Points
0
For any reason I forgot Mysql root password and could not log into mysql server on my vps, how can I find this out? Is there any file where this password is stored?
 

ValeriaMxc

New member
Registered
Joined
Oct 12, 2012
Messages
12
Points
0
If you are using cPanel, run this command

Code:
cat /root/.my.cnf
You can get password like this
Code:
[client]
user="root"
password="u1lHDR2bfmrqi"
If you are using Directadmin, run this command

Code:
cat /usr/local/directadmin/conf/mysql.conf
If you are using Plesk, run this command

For Linux:

Code:
# /usr/local/psa/bin/admin --show-password
For Windows:

Code:
"%plesk_bin%\plesksrvclient" -get
 

UWH-David

Member
Registered
Joined
Jan 18, 2016
Messages
45
Points
8
For any reason I forgot Mysql root password and could not log into mysql server on my vps, how can I find this out? Is there any file where this password is stored?
For most Linux platforms this will be how you perform this:

Code:
/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -u root
use mysql;
update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
flush privileges;
quit
/etc/init.d/mysql stop
/etc/init.d/mysql start
and if you are using cPanel, you can just change the MySQL pass via the web host manager interface very quickly.
 
Latest Threads
Replies
0
Views
125
Replies
1
Views
79
Replies
0
Views
100
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top