Mac解决mysql stop报错问题:The /usr/local/mysql/data directory is not owned by the ‘mysql‘ or ‘_mysql‘
报错信息:The /usr/local/mysql/data directory is not owned by the ‘mysql’ or ‘_mysql’ user.
Mac上MySQL报错信息
Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' user.
解决方案
1.执行命令:sudo chown -R mysql /usr/local/mysql/data
2.输入密码:
beiluo@beiluodeMBP ~ % sudo chown -R mysql /usr/local/mysql/data
Password:
3.查看:
mysql正常运行。
原因:
百度的原因是,可能是某种情况下/usr/local/mysql/data的所有者或者所属组发生了变化。上面终端使用的chown命名将/usr/local/mysql/data目录下所有文件所有者改成mysql即解决该问题。