转自:Penkace 的博文

最近安装了mysql,在使用“ set password for [email protected]=password('123456');”时会遇到

“ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password('123456')' at line 1”的错误提示。

新版mysql改初始密码

此外,还有使用以下语句修改初始密码时出现的错误提示:

“select User, Password from mysql.user;”

新版mysql改初始密码

导致这些错误出现的原因是mysql的版本问题,我使用的是mysql8.0.11版本,解决该问题使用的语句是:

“ ALTER USER 'root'@'localhost' identified by '123456' ; ”

新版mysql改初始密码

之后刷新再重新用新的密码登陆即可。

新版mysql改初始密码

Mysql在更新到8.0版本之后,更新了内部的组件,详细的可以查看官方的文档https://dev.mysql.com/doc/refman/8.0/en/security.html Mysql官方文档

相关文章:

  • 2022-12-23
  • 2021-07-20
  • 2021-05-05
  • 2021-11-20
  • 2021-11-21
  • 2021-07-16
  • 2021-07-31
猜你喜欢
  • 2022-02-23
  • 2021-03-29
  • 2021-12-05
  • 2022-02-04
  • 2021-04-15
  • 2021-08-01
  • 2021-12-23
相关资源
相似解决方案