查看mysql状态

ps -ef | grep -i mysqld

关闭mysql

service mysqld stop

my.cnf配置文件的位置,一般在/etc/my.cnf,有些版本在/etc/mysql/my.cnf

在配置文件中,增加2行代码

[mysqld]

skip-grant-tables

开启mysql

service mysqld start

直接登录mysql -u root -p

update mysql.user set authentication_string=password('你的新密码') where user='root';

把刚才my.cnf里面加的语句删了,重启mysql

service mysqld start


相关文章:

  • 2022-02-17
  • 2021-11-27
  • 2021-12-18
  • 2022-12-23
  • 2021-07-11
  • 2021-11-18
猜你喜欢
  • 2021-11-20
  • 2022-02-11
  • 2022-12-23
  • 2021-07-09
  • 2021-08-26
  • 2022-03-06
  • 2022-02-06
相关资源
相似解决方案