“mysql_upgrade”在 M1 Mac 上拒绝用户“root”@“localhost”访问

问题描述 投票:0回答:2

我在他们的网站上按照 macos 安装了 MariDB,当我尝试运行时总是收到此错误

mysql_upgrade

由于同样的错误,我也无法确保安装安全

Reading datadir from the MariaDB server failed. Got the following error when executing the 'mysql' command line client
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
FATAL ERROR: Upgrade failed

我尝试了以下教程,但不起作用。

我该怎么办?

编辑

抱歉,我忘了我在这里发布了一个问题。

现在一切都好啦!我能够让它发挥作用。我所做的就是使用

mariadb -u root -p
代替,密码是
root

我使用的教程是Mariadb官网的教程。

至于这个解决方案,我忘记了从哪里得到的,但是,感谢帮助我的你!

installation mariadb homebrew apple-m1
2个回答
1
投票

您还没有发布您遵循了哪些教程。 你试过吗

mysql_upgrade -p

它将提示输入 root 密码。您甚至可以使用

-u
选项与其他用户一起运行它。

希望这有帮助。

仅供参考:https://mariadb.com/kb/en/mysql_upgrade/


0
投票

我在使用 nextcloud 运行 yobasystems alpine mariadb 的 docker 容器时遇到此错误。我将数据库映像升级到新版本,但是需要此命令才能在 docker 中实际执行更新,这并不容易理解。对我有用的是:

docker exec -it nextcloud-db /bin/sh -c 'mysql_upgrade -u root -p nextcloud -h db'

然后在提示时输入我的 mysql root 密码。

nextcloud-db 是我的容器名称 nextcloud 是数据库名称 db 是我的主机名,而不是 localhost,此命令默认也没有 -h [host]

希望这可以帮助其他陷入我困境的人。我将设置一个脚本来在容器版本升级时为我运行它。

© www.soinside.com 2019 - 2024. All rights reserved.