1,service mysql stop       # mysql5.1版本的服务名是 mysqld,而mysql5.6版本的二进制包的服务名是 mysql.

2, /etc/init.d/mysql start  --skip-grant-tables

3,mysql

>  此时就可以在mysql里面修改root密码了

mysql> update mysql.user set password= password('123456') where user='root';

4,/etc/init.d/mysql stop 

5, mysql -uroot -p123456     # ------> 此时就可以进入到MySQL了。

mysql>  

 

mysql> grant all privileges on *.* to root@'localhost' identified by '123456';    #这条命令在 --skip-grant-tables状态下修改不了密码表。
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it ca
mysql>

相关文章:

  • 2022-03-03
猜你喜欢
  • 2021-10-26
  • 2022-02-28
  • 2021-07-12
相关资源
相似解决方案