当前位置:Gxlcms > 数据库问题 > Linux mysql忘记密码 修改密码 解决方法

Linux mysql忘记密码 修改密码 解决方法

时间:2021-07-01 10:21:17 帮助过:3人阅读

  • 编辑配置文件
    • vim /etc/my.cnf
    • 在【mysqld】下添加skip-grant-tables,保存并退出
  • 重启mysql服务:
    • service mysqld restart
  • 修改root用户密码
    • 重启后,输入mysql直接进入MySQL命令行
    • update mysql.user set  authentication_string=password(‘密码‘) where user=‘root‘;
    • flush privileges;
    • exit;
  • 重启mysql服务
    • service mysqld restart
  • 正常登录mysql
    • mysql -u root -p

Linux mysql忘记密码 修改密码 解决方法

标签:解决方法   配置   HERE   sql命令   res   The   root用户   ice   roo   

人气教程排行