在my.cnf文件的 [mysqld] 添加 skip-grant-tables=1 然后重启 update mysql.user set authentication_string=password('') where user = 'root';