User Tools

Site Tools


mysql:reset_root_password

MySQL - Reset root password

To recover the MySQL root password if forgotten.

  • Stop the mysqld daemon process.
  • Start the mysqld daemon process:
    --skip-grant-tables
  • Start the mysql client
    -u root
  • 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.txt · Last modified: 2020/07/15 10:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki