最近安装了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”的错误提示。

解决SQL不能修改初始化密码的问题

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

“select User, Password from mysql.user;”

解决SQL不能修改初始化密码的问题

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

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

解决SQL不能修改初始化密码的问题

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

解决SQL不能修改初始化密码的问题

相关文章:

  • 2022-01-14
  • 2022-12-23
  • 2021-07-25
  • 2021-11-18
  • 2021-08-14
  • 2021-12-05
  • 2022-01-18
  • 2022-02-04
猜你喜欢
  • 2022-02-23
  • 2021-08-13
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
相关资源
相似解决方案