首页 > 其他分享 >You must reset your password using ALTER USER statement before executing this statement.

You must reset your password using ALTER USER statement before executing this statement.

时间:2023-10-21 11:33:53浏览次数:30  
标签:reset log 密码 statement MySQL password root your

  安装mysql-5.7.32数据库时,初次登陆MySQL,执行如下命令获取临时密码,/var/log/mysqld.log 为my.cnf中log-error配置项的内容:

grep 'temporary password' /var/log/mysqld.log

  获取临时密码:!.IRoNewC7xq,执行结果如下:

0

   初次使用临时密码登录 MySQL,查看MySQL数据库时,出现如下问题:

0

  原因是root用户没有设置密码,执行如下命令:

# 为 root 用户设置密码
set password=password("root");
# 刷新
flush privileges;

  再次查看数据库,结果如下:

0  

标签:reset,log,密码,statement,MySQL,password,root,your
From: https://www.cnblogs.com/RunningSnails/p/17778687.html

相关文章