无法在macos上使用brew成功运行mariaDB

qlfbtfca  于 10个月前  发布在  Mac
关注(0)|答案(1)|浏览(63)

我有一个mac版本12.5.1,我试图安装MariaDB与自制
我一直在关注这个guide
但是当我运行mysql_install_db时,我得到:
mysql.user table already exists! Run mariadb-upgrade, not mariadb-install-db
然后当我运行mariadb-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
我已成功以root用户身份登录,但无法创建任何数据库

MariaDB [(none)]> CREATE DATABASE wp_new;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'wp_new'

字符串
如果我尝试以sudo运行:

GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost';
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)


我尝试了所有的方法,不确定如何给予root完全权限和授予特权,没有任何效果

laximzn5

laximzn51#

不知怎么的,它被修好了,不知道到底是什么造成的。
我卸载了所有的东西,然后重新安装。
我确实把这个放在/usr/local/etc/my.cnf上了

[mysqld]
default_authentication_plugin = mysql_native_password

字符串
然后呢

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new_password';


最终,它工作了,不知道为什么,但我设法在没有sudo的情况下运行了这个命令,然后我就可以改变root了。
mysqld_safe --skip-grant-tables
一切都很奇怪,还不确定到底是什么造成的

相关问题