Modify the MySQL configuration file my.cnf, the path is/ETC/MY.CNF
Write a line skip-grant-tables in the configuration file, save and exit after adding, as
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/79/74/wKioL1aR-HfzDOxdAAAZwP_l6kQ197.png "title=" Mysqld.png "alt=" Wkiol1ar-hfzdoxdaaazwp_l6kq197.png "/>
After the completion of the addition, restart the mysqld, after the restart is complete directly with the root user login, you can go directly into the, this time do not need a password, haha
Log in and quickly change the password to:
mysql.user set Password=password ("123") where user= ' root ' andhost= '% ';
Mysql>flush Privileges If you do not execute this after the change, quit mysql in or do not need a password, execution after the exit to enter the new password must be entered
After changing the password, remember to change the configuration file back.
Note: When you go in and change your password, Don't use s et Password=password ("123"); Such modification Oh, will error, error message as follows: Error 1290 (HY000): The MySQLServer is running with the-- Skip-grant-tables option so it cannot execute thisstatement
Probably the meaning is that in this skip-grant-tables option cannot execute this command, or you can use the update to change it.
This article is from the "I Just passing ah" blog, please be sure to keep this source http://justdb.blog.51cto.com/11092943/1733458
MySQL root user password forgot what to do