Showing posts with label Reset MYSQL root password. Show all posts
Showing posts with label Reset MYSQL root password. Show all posts

Reset MySQL Root Password

0 comments

Here’s a quick way to reset your mysql root password. Replace ‘NewRootPass’ with your new root password and run the following as root.

/etc/init.d/mysql stop
mysqld --skip-grant-tables --user mysql &
mysql -u root -e "UPDATE mysql.user SET Password=PASSWORD('NewRootPass') WHERE User='root'"
/etc/init.d/mysql restart
Note: This was done on CentOS. You might need to adjust the path to mysql’s startup scripts accordingly.

Reset MYSQL root password

0 comments


Simple steps to reset the mysql root password if you have forgotten it.

1. Stop the mysqld daemon process.

2. Start the mysqld daemon process with the '–skip-grant-tables' option.

3. Start the mysql client with the -u root option.

4. Execute the following:
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';

5. Execute the following:
FLUSH PRIVILEGES;