gpt4 book ai didi

mysql - MySQL设置密码错误

转载 作者:可可西里 更新时间:2023-11-01 07:30:29 27 4
gpt4 key购买 nike

我正在尝试使用以下命令重置我的 root 密码:

SET PASSWORD FOR 'root'@'localhost' = PASSWORD('test');

它给了我以下错误:

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('test')' at line 1

请让我知道我在这里做错了什么。

最佳答案

我知道它很旧,但它可以提供帮助。

我在使用 PASSWORD() 函数时遇到了这个错误:

SET PASSWORD FOR 'myuser@localhost' = PASSWORD('my_new_password');

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('basket8')' at line 1

因为在 MySQL 5.7 及更高版本中,不需要使用 PASSWORD() 函数:

SET PASSWORD FOR 'myuser'@'localhost' = 'my_new_password';
Query OK, 0 rows affected (0.01 sec)

关于mysql - MySQL设置密码错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29866692/

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