liugx
mysql的root忘记,现无法操作数据库
停止mysql服务service  mysql stop
然后使用如下的参数启动mysql, --skip-grant-tables会跳过mysql的授权
shell#/usr/bin/mysqld_safe --skip-grant-tables &
mysql -p  回车,进入不需要密码
mysql>
mysql>update mysql.user set Password=password(\'123456\') where User=\'root\';
Query OK, 4 rows affected (0.00 sec)
Rows matched: 4  Changed: 4  Warnings: 0
mysql> flush privileges;  
Query OK, 0 rows affected (0.00 sec)
 
重启mysql

分类:

技术点:

相关文章:

  • 2021-08-09
  • 2021-10-26
  • 2021-11-28
  • 2021-09-27
  • 2021-09-27
  • 2021-03-29
  • 2021-09-01
  • 2019-12-10
猜你喜欢
  • 2018-12-03
  • 2021-12-13
  • 2021-06-15
  • 2021-05-13
  • 2021-10-09
相关资源
相似解决方案