ABHIONLINUX
Site useful for linux administration and web hosting

Showing posts with label mysql passowrd reset. Show all posts
Showing posts with label mysql passowrd reset. Show all posts

2009/11/16

Reset password for mysql

Error:
--------------
connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'
mysql has failed, please contact the sysadmin (result was "mysql has failed").

Please follow the steps to reseset password for mysql.

Try the below steps :-
1) Set the passwd for mysql in /root/.my.cnf
2) killall mysqld
3) Restart mysqld with the --skip-grant-tables option as below :-
/usr/bin/safe_mysqld --skip-grant-tables &
4) Connect to Mysql :- Just type 'mysql' at the prompt without those quotes.
5) Update passwd for root user with the below command :-
> update user set Password = Password('pass') where User ='root';
6) exit