解决:/opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.err: Permission denied
一·问题描述:
1.由于更新Mac系统,导致本地mysql服务启动报错
2.报错主要存在两个异常:
(1) /opt/homebrew/Cellar/mysql/8.1.0/bin/mysqld_safe: line 144: /opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.err: Permission denied
(2)ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.pid).
3.以及查看该无操作权限的文件截图:/opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.err
二·问题原因:
1.操作/opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.err该文件的权限不足
2.缺少一个/opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.pid文件
三·解决方案:
1.先给mysql的data目录重新授权:
sudo chmod -R 755 /opt/homebrew/var/mysql
2.再单独给/opt/homebrew/var/mysql/cpe-172-100-102-183.twcny.res.rr.com.err文件重新授权:
sudo chmod 777 cpe-172-100-102-183.twcny.res.rr.com.err
3.再启动mysql服务:成功!(给cpe-172-100-102-183.twcny.res.rr.com.err文件授权之后,重启mysql自动生成cpe-172-100-102-183.twcny.res.rr.com.pid文件)
#启动mysql服务命令
mysql.server start