1.先登录数据库

mysql -u root -p

不需要输入密码

2.选择MySQL数据库

use mysql;

3.更新数据库密码

update user set password=PASSWORD('root') where USER='root';

4.FLUSH PRIVILEGES;

root密码为空时修改密码

相关文章:

  • 2021-06-04
  • 2021-11-24
  • 2021-09-05
  • 2021-09-25
  • 2021-07-18
  • 2021-04-05
  • 2021-05-28
猜你喜欢
  • 2021-08-13
  • 2021-09-15
  • 2022-01-05
  • 2021-08-22
  • 2022-12-23
  • 2022-12-23
  • 2021-04-03
相关资源
相似解决方案