无法使用自制连接到本地mysql服务器

ulydmbyx  于 2021-06-21  发布在  Mysql
关注(0)|答案(1)|浏览(501)

我以前在macbook pro的另一个用户上安装过带自制的mysql服务器,但我必须更改用户,现在我无法启动mysql服务器:

$ mysql.server start
Starting MySQL
./usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144: 
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144: 
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 198: 
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
/usr/local/Cellar/mysql/5.7.22/bin/mysqld_safe: line 144: 
/usr/local/var/mysql/Stefans-MacBook-Pro.local.err: Permission denied
ERROR! The server quit without updating PID file 
(/usr/local/var/mysql/Stefans-MacBook-Pro.local.pid).

用户 "Stefan" 已经不存在了。也许你的权利 /usr/local/var/mysql 不正确,但我不确定我能做些什么来修复它。
权利包括:

$ sudo ls -lah /usr/local/var/mysql/
Password:
total 221392
drwxr-xr-x   20 501  admin   640B 25 Apr 15:47 .
drwxrwxr-x    8 501  admin   256B 20 Apr 10:12 ..
-rw-r-----    1 501  admin    60K 25 Apr 15:47 Stefans-MacBook-Pro.local.err
-rw-r-----    1 501  admin    56B 20 Apr 10:12 auto.cnf
-rw-------    1 501  admin   1,6K 20 Apr 10:12 ca-key.pem
-rw-r--r--    1 501  admin   1,1K 20 Apr 10:12 ca.pem
-rw-r--r--    1 501  admin   1,1K 20 Apr 10:12 client-cert.pem
-rw-------    1 501  admin   1,6K 20 Apr 10:12 client-key.pem
-rw-r-----    1 501  admin   464B 25 Apr 15:47 ib_buffer_pool
-rw-r-----    1 501  admin    48M 25 Apr 15:47 ib_logfile0
-rw-r-----    1 501  admin    48M 20 Apr 10:12 ib_logfile1
-rw-r-----    1 501  admin    12M 25 Apr 15:47 ibdata1
drwxr-x---   77 501  admin   2,4K 20 Apr 10:12 mysql
drwxr-x---   90 501  admin   2,8K 20 Apr 10:12 performance_schema
-rw-------    1 501  admin   1,6K 20 Apr 10:12 private_key.pem
-rw-r--r--    1 501  admin   452B 20 Apr 10:12 public_key.pem
-rw-r--r--    1 501  admin   1,1K 20 Apr 10:12 server-cert.pem
-rw-------    1 501  admin   1,6K 20 Apr 10:12 server-key.pem
drwxr-x---  108 501  admin   3,4K 20 Apr 10:12 sys
drwxr-x---   25 501  admin   800B 20 Apr 12:00 textspinner

我也尝试重新安装mysql服务器,但它不工作。
我怎样才能解决这个问题?

zpf6vheq

zpf6vheq1#

好的,有了这个帖子我可以解决这个问题:
https://coderwall.com/p/os6woq/uninstall-all-those-broken-versions-of-mysql-and-re-install-it-with-brew-on-mac-mavericks

相关问题