【发布时间】:2021-03-31 16:58:51
【问题描述】:
我刚升级到 MacOS Big Sur,发现无法使用mysql -u root(无密码)登录 mysql 控制台。
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
我用 brew 安装了 MariaDB (brew install mariadb)
我检查了mysql守护进程,发现如下错误
Xuans-MacBook-Pro:~ xuan$ mysqld
2020-12-21 15:46:27 0 [Note] mysqld (mysqld 10.5.8-MariaDB) starting as process 2091 ...
2020-12-21 15:46:27 0 [Warning] Can't create test file /usr/local/var/mysql/Xuans-MacBook-Pro-2.lower-test
2020-12-21 15:46:27 0 [ERROR] mysqld: File '/usr/local/var/mysql/aria_log_control' not found (Errcode: 13 "Permission denied")
2020-12-21 15:46:27 0 [ERROR] mysqld: Got error 'Can't open file' when trying to use aria control file '/usr/local/var/mysql/aria_log_control'
2020-12-21 15:46:27 0 [ERROR] Plugin 'Aria' init function returned error.
2020-12-21 15:46:27 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
2020-12-21 15:46:27 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2020-12-21 15:46:27 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be writable
2020-12-21 15:46:27 0 [ERROR] Plugin 'InnoDB' init function returned error.
2020-12-21 15:46:27 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
2020-12-21 15:46:27 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-12-21 15:46:27 0 [ERROR] Could not open mysql.plugin table: "Table 'mysql.plugin' doesn't exist". Some plugins may be not loaded
2020-12-21 15:46:27 0 [ERROR] Failed to initialize plugins.
2020-12-21 15:46:27 0 [ERROR] Aborting
这里是/usr/local/var/mysql/的权限
drwxr-xr-x 68 xuan admin 2176 21 Dec 15:48 mysql
套接字文件位置
Xuans-MacBook-Pro:xuan$ mysqld --help --verbose | grep sock
socket /tmp/mysql.sock
unix-socket ON
有什么建议吗?
【问题讨论】:
-
aria相关的错误只针对mariadb,所以这个问题不适用于mysql。
-
我也升级到了 big sur,我也遇到了同样的问题,尽管 mariaDB 没有。当我尝试做 rails s puma 时,会弹出此错误。
sudo mysql -uroot抛出同样的错误
标签: macos mariadb macos-big-sur