Difference between revisions of "Lost MySQL root password?"

From Kolmisoft Wiki
Jump to navigationJump to search
(New page: Ok, if this is your only problem this little trick will show how to recover your root password. Proceed as follows. * Stop the db engine /etc/init.d/mysql stop * Restart the daemon...)
 
(Replacing page with 'http://www.debianhelp.co.uk/mysqlroot.htm')
Line 1: Line 1:
Ok, if this is your only problem this little trick will show how to recover your root password.
http://www.debianhelp.co.uk/mysqlroot.htm
 
Proceed as follows.
 
* Stop the db engine
 
    /etc/init.d/mysql stop
 
* Restart the daemon
 
    /usr/bin/mysqld_safe –skip-grant-tables &
 
* Go to the MySQL interactive command
 
    mysql -h your_hostname mysql
 
* Change the password with the GRANT command
 
    GRANT ALL PRIVILEGES ON * to root@localhost IDENTIFIED BY ‘passwd’;
    FLUSH PRIVILEGES;
 
Maybe it should be better to flush privileges from mysqladmin:
 
    mysqladmin -h localhost flush-privileges
 
That’s it. Now try to login as usual.
 
----
 
Pasted from: http://www.karkomaonline.com/index.php/2003/08/10/lost-mysql-root-password/

Revision as of 21:38, 18 December 2007