vi /etc/my.cnf 在[mysqld]添加 skip-grant-tables /etc/init.d/mysqld restart mysql >update mysql.user set password=PASSWORD("新密码") where User="root"; >flush privileges; /etc/init.d/mysql restart