mysql:reset_root_password
This is an old revision of the document!
MySQL - Reset root password
To recover the MySQL root password if forgotten.
- Stop the mysqld daemon process.
- Start the mysqld daemon process with
--skip-grant-tables
option.
- Start the mysql client with the
-u root
option.
- Execute the command
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
- Execute the command
FLUSH PRIVILEGES;
- Use mysqladmin to shut down the MySQL daemon:
mysqladmin shutdown
- Start MySQL server as per normal
mysql/reset_root_password.1585815222.txt.gz · Last modified: 2020/07/15 09:30 (external edit)