Set root password above MySql8.0
Since mysql8.0 and later versions removed the previous built-in password method, the previous password setting tutorial is invalid. Need to adopt a new method
1. Open cmd.exe with administrator privileges, enter the net stop mysql command to stop the current mysql service
2. Start the mysql service without setting permissions:
3. Re-open cmd with the administrator. Enter mysql -uroot -p Log in with root, and press Enter when prompted to enter the password.
4. After entering mysql, switch to the mysql database:
5. Change the field "authentication_string" in the user table in the mysql database to ""
6. At this time, because of the use of – Skip-grant-table login, all, you can’t change the root password yet, the programmer switches off the global read-only status:
Change the read-only attribute:
Refresh permissions:
7. Now you can enter your new root password