Initialize the mysql user's password. after installing mysql for the first time, use root to log on to mysql. The token will prompt you to enter the password. However, the root password is not prompted during the installation process. What should we do? Modify my. The conf configuration bypasses mysql authorization verification and resets the password of the root user. The procedure is as follows:
1) stop the currently running mysql service
/Etc/init. d/mysql stop
2) modify my. conf
Add the following statement to the my. conf file.
# Skip-grant-tables
Save and exit
3) restart the mysql service.
4) mysql-hlocalhost-root directly enters the mysql management Terminal
Use mysql; // use the mysql database to update user set password = password ('newpassword') where user = root; // modify the password of the root user flush privileges; // refresh quit; // exit
5) restore the my. conf file
Add # before skip-grant-table
Skip-grant-table
6) restart the mysql service.
/Etc/init. d/mysql restart
7) mysql-hlocalhost-uroot-p // enter the correct root password to log on.
//