【发布时间】:2021-01-07 11:59:27
【问题描述】:
这似乎是一个简单的问题,但却给我带来了无数小时的挫败感。它只是房子里的一个小盒子,我用来玩。
我尝试了 skip-grant-tables 版本并使用了 authentication_string 字段,而不是仍在使用的密码版本。我也尝试过 init-file 方法,但没有任何乐趣。
如果我使用 skip-grant-tables 版本并使用以下行:
update user set authentication_string=password('whywontitwork') where user='root';
我得到的结果是:
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 '('whywontitwork') where user='root'' at line 1
我(完全)不明白语法有什么问题。这让我为应该是一个小问题而发疯(我认为)。有人有什么想法吗?提前致谢。 MySQL Ver 8.0.21-0ubuntu 在 Ubuntu 20.04 上运行。
【问题讨论】:
-
查询表时必须指定数据库,即使用
mysql.user -
从重复问题的答案请关注这个:stackoverflow.com/a/58517061/5389997
标签: mysql