/etc/my.cnf [mysqld]下添加skip-grant-tablesservice mysql restartmysql 无密码登陆use mysqlupdate mysql.user set authentication_string=password(‘123456’) where user=‘root’;flush privilegesquit去掉skip-grant-tablesmysql -uroot -p