How do i reset mysql after I forgot my password?
Background: Today to use the MySQL database to do the test, the test machine on the MySQL forgot password, how to do? Here is the workaround.
If MySQL is running, first kill it: Killall-term mysqld.
Start MySQL:/usr/bin/safe_mysqld--skip-grant-tables &
You can go to MySQL without a password.
Then there is
>use MySQL
>update User Set Password=password ("New_pass") where user= "root";
>flush privileges;
Re-kill MySQL, the normal way to start MySQL, MySQL password empty.
Mysql-uroot-p return, let enter the password, direct return can. 650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/59/C6/wKioL1ThoNjxoq7QAAGr4m62OG8039.jpg "title=" QQ picture 20150216154411.png "alt=" Wkiol1thonjxoq7qaagr4m62og8039.jpg "/>
This article is from the "Technical Achievement Dream" blog, please be sure to keep this source http://pizibaidu.blog.51cto.com/1361909/1614672
How do i reset mysql after I forgot my password?