Starting MySQL with --skip-grant-tables
Locking out the root user from a MySQL database can be a frustrating experience. To regain access and restore privileges, it's necessary to start MySQL with the --skip-grant-tables option.
Step 1: Stop the MySQL Service
For Windows users, stop the MySQL service using the Administrator tools within Services.
Step 2: Edit the my.ini Configuration File
Locate the my.ini configuration file, typically found in one of these paths:
Step 3: Add the --skip-grant-tables Option
In the [mysqld] section of the file, add the following line:
skip-grant-tables
Step 4: Restart the MySQL Service
Start the MySQL service again. You should now be able to log in to your database without a password and regain access to the root user.
The above is the detailed content of How to regain MySQL root access using the --skip-grant-tables option?. For more information, please follow other related articles on the PHP Chinese website!