Reset mysql root password

To reset the mysql root password follow these steps

1. Stop running mysql instances

# service mysqld stop

1a. If that doesn’t work then kill all running mysql instances

# pkill mysql

1. Stop running mysql instances

# service mysqld stop

2. Start Mysql in safe mode

# mysqld_safe --skip-grant-tables

3. Run these command replacing somepassword with your new password

mysql> update mysql.user set Password=PASSWORD('somepassword') where user='root';
mysql> flush privileges;
mysql> exit;

4. Start mysqld again

# service mysqld stop

Leave a Reply

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>