When you lose the root password, you can do this
mysqld_safe --skip-grant-tables&
mysql -u root mysql
mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root';
mysql> FLUSH PRIVILEGES; please respect For more information, please refer to http://www.cezuwang.com/listFilm?page=1&areaId=906&filmTypeId=1 When running mysql, it prompts that Table 'performance_schema.session_variables' doesn't exist The solution is: Step 1: Enter in the administrator command: mysql_upgrade -u root -p --force Step 2: Restart the mysql service: net stop mysqlnet start mysql Run mysql again, and it will be solved. Note that both steps are indispensable.