gpt4 book ai didi

mysql 错误 1064 哪里

转载 作者:行者123 更新时间:2023-11-29 18:43:21 25 4
gpt4 key购买 nike

我需要帮助...尝试为 mysql 设置密码

我开始创建一个用户:它成功了!

mysql> CREATE USER admin@localhost;
Query OK, 0 rows affected (0.02 sec)

我正在尝试分配密码,但这不起作用,并且收到以下错误:

mysql> UPDATE mysql.user SET authentication_string = PASSWORD <'PHP1234'> WHERE USER = 'admin';

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 'WHERE USER = 'admin'' at line 1

您能否帮助解决我收到的错误消息或我需要如何编写它?

最佳答案

尖括号应该是圆括号您可以使用以下两种语法为用户设置密码:

UPDATE mysql.user SET Password=PASSWORD('new-password-here') WHERE USER='user-name-here' AND Host='host-name-here';

SET PASSWORD FOR 'user-name-here'@'hostname-name-here' = PASSWORD('new-password-here');

关于mysql 错误 1064 哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44787037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com