1,ubuntu中mysql好久没用了,密码忘记了,
首先停止mysql
/etc/init.d/mysql stop
然后以不检查权限的方式启动mysql
mysqld_safe --skip-grant-tables &
然后root用户以空密码登录mysql
mysql -u root
然后修改root用户密码:
mysql> update mysql.user set password=PASSWORD('新密码') where User='root'; 
mysql> flush privileges; 
mysql> quit 
最后重新启动mysql:
/etc/init.d/mysql restart
就可以使用新密码登录了

相关文章:

  • 2021-09-20
  • 2022-02-14
  • 2021-11-12
  • 2021-07-21
  • 2021-08-25
  • 2022-01-12
  • 2021-09-05
  • 2022-02-20
猜你喜欢
  • 2021-04-25
  • 2021-09-02
  • 2022-03-04
  • 2021-09-16
  • 2021-05-22
  • 2022-02-03
  • 2021-09-19
相关资源
相似解决方案