【发布时间】:2020-01-28 03:46:39
【问题描述】:
我刚刚在 macOS Mojave 上安装了 MariaDB 10.4,现在我需要为 root 用户设置密码。我阅读了其他 SO 问题,我可以通过
sudo mysql -u root
MariaDB [mysql]> UPDATE mysql.user SET authentication_string = PASSOWRD('mypassword') WHERE user = 'root';
但这会引发错误
ERROR 1348 (HY000): Column 'authentication_string' is not updatable
如果我尝试
UPDATE mysql.user SET Password=PASSWORD('mypassword') WHERE User='root';
引发错误
ERROR 1348 (HY000): Column 'Password' is not updatable
这个
set password for 'root'@'localhost' = 'mypassword';
抛出
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number
还有这个
alter user 'root'@'localhost' identified with mysql_native_password by 'mypassword';
抛出
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version...
我该如何解决这个问题?
【问题讨论】:
-
为什么我们会导致这个问题?