修改MySQL root密码方式
1,mysql丢失ROOT密码操作方法:
#/etc/init.d/mysqld stop
#mysqld_safe --skip-grant-tables &
#mysql -u root
mysql> use mysql;
mysql> UPDATE user SET password=PASSWORD('new password') WHERE user='root';
mysql> FLUSH PRIVILEGES;
#/etc/init.d/mysqld restart
2,修改ROOT密码方法:
mysql>USE mysql;
mysql>UPDATE USER SET `password`=PASSWORD('123') WHERE USER='root';
mysql>FLUSH PRIVILEGES;
阅读(1291) | 评论(0) | 转发(0) |