Linux

Categorized | Database

Reset the MySQL password

You forgot your MySQL password. No problem, you can recover it easily. Stop the MySQL service with

# /etc/init.d/mysql stop

…and restart it without a password:

# mysqld_safe –skip-grant-tables &

You’ll get an output similar to [1] 5958. Now press Enter and type the following one after the other:

# mysql -u root

mysql> use mysql;

mysql> update user set password=PASSWORD(”NEW-ROOT-PASSWORD”) where User=’root’;

mysql> flush privileges;

mysql> quit

# /etc/init.d/mysql restart

It’s all done now and you should be able to login with the new password.

Author Profile

T4L ;

Other posts by T4L

Author's web site



Are you satisfied with this blog?
Why not subscribe our RSS Feed? you will always get the latest post.


1 Comment


  1. You forgot to tell that --skip-grant-tables is written with double line.

    1

1 Trackback(s)

  1. 16 10 2009 : Todo Computacion » Como resetear la clave de root de Mysql

Leave A Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>