Ubuntu (Linux):
First, go to the command line.
Log in as root, command:
Mysql-uroot-p
Enter the password in return;
Mysql>use MySQL;
Mysql>update user SET Password=password (' Enter new password ') WHERE user= ' root ';
Mysql>flush privileges;
has been completed.
Windows:
Under the Windows command line, modify the MySQL database password step as follows:
1, through the DOS command into the MySQL bin directory;
2, input "Mysql-uroot-p", enter the MySQL command state;
3, if Root has a password, MySQL will prompt to enter the original password, and then into the MySQL command state;
4. If you change the root user password to 123456, enter it in the MySQL command state:
Update Mysql.user set Password=password (' 123456 ') where user= ' root ';
Prompt for query OK, indicating that it has been updated.
5. Enter the flush privileges; To save the changes, enter it in the MySQL command state:
FLUSH privileges; Enter
At this point, the password modification is complete.
Ubuntu Modify Web Database MySQL password method and modify MySQL password under Windows