1. 找到my.cnf(一般会在 /etc/my.cnf) 2.在[mysqld]的段中加上一句:skip-grant-tables [mysqld] datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock skip-name-resolve **skip-grant-tables** 进行重启 service mysql restart