How can I find out Mysql root password?

DA31387

Verified User
Joined
Sep 21, 2011
Messages
56
I cannot figure out mysql root pasword. Any idea how to get it would be very appreciated.
Thank you
 
cat /usr/local/directadmin/conf/mysql.conf

when i do that command it asks for password,
i input the password i got from these command

bash-4.1# mysqladmin -u root -p version
Enter password:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
 
Possibly your password has been updated before, since the machine was built. The file holding the password is not interactive; it's written once when DirectAdmin is installed.

You can reset a MySQL root password; use Google to search the DirectAdmin knowledgebase at http://help.directadmin.com.

Jeff
 
reset Mysql Root password:
/etc/init.d/mysqld stop
mysqld_safe --skip-grant-tables &
mysql -uroot -p ( hit enter, without any password)
use mysql
UPDATE mysql.user SET password=PASSWORD('your_new_password') WHERE user='root';
FLUSH PRIVILEGES;
quit
/etc/init.d/mysqld restart
 
Back
Top