1.先停止mysql服务 service mysqld stop 2.启动mysql服务 并跳过权限认证 mysqld_safe --skip-grant-tables 3.打开另外一个终端 登录mysql [root@mysql ~]# mysql -uroot -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id Server version:…