logos

With Andrii Grytsenko


Technical Diary - With Andrii Grytsenko

Reset mysql password in several steps.

Make new password for mysql user in 5 simple steps.

1.Stop mysql server:

#service mysql stop

2.Start in safe mode(use Ctrl+Z to send process to background):

#/usr/bin/mysqld_safe --skip-grant-tables --user=root &

3.Login as root:

#mysql -u root

4.Make mysql execute next queries:

UPDATE mysql.user SET Password=PASSWORD(’newpwd’) WHERE User=’root’;
FLUSH PRIVILEGES;
exit;

Where newpwd is a new password for mysql user “root”.
5.Restart mysql:

#service mysql restart

Now you are ready to connect to server with new password.

Leave a Reply

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

Categories

Translate