In Mysql, Flush privileges mysql> update mysql. user set password = PASSWORD ('new password') where User = 'root'; mysql> flush privileges; mysql> exit; mysql needs flush privileges to refresh the MySQL system permission table after setting a user or changing the password. Otherwise, access is denied. Another method is to restart the mysql server, to make the new settings take effect. Example: 1. after the user root enters mysql and then opens mysql database (use mysql),-create user stu identified by 'stu'; # create a user stu and add the password to stu exit; # exit Test 2. use a new user to re-enter mysql-ustu-pstu # success 3. re-use the root user to enter mysql and open mysql database update user set password = password ('000000') where user = 'std'; # change the stu user password to 123456 exit; # exit test again-4. log in directly as the user stu and use the new password to check whether mysql-ustu-p123456 is successful; # An error is reported. The password is incorrect. log on to the mysql database as the root user again, and modify the user password again-update user set pas Sword = password ('000000') where user = '000000'; # change the stu user password to 123456 flush privileges; # refresh the MySQL system permission table-exit; 6. log out again and enter the stu User Password 123456. The test is successful! --------------------------------------------------- After updating user permissions, refresh the permission table! After modifying the mysql. user table, you also need to refresh the permission!