EricLi404 / notes

踩坑记录
0 stars 0 forks source link

启动mysql 失败,“Warning:The /usr/local/mysql/data directory is not owned by the 'mysql' or '_mysql' ” #4

Open EricLi404 opened 7 years ago

EricLi404 commented 7 years ago

0x00 问题描述

macOS的升级等原因可能会导致MySQL启动时, 在MySQL操作面板上提示“Warning:The /usr/local/MySQL/data directory is not owned by the ‘mysql‘ or ‘_mysql‘ ”;

0x01 问题分析

/usr/local/mysql/data 的宿主发生了改变。

0x02 解决方案

Linux :

sudo chown -R mysql /usr/local/mysql/data

macOS :

sudo chown -R _mysql:wheel /usr/local/mysql/data

P.S.

关于 wheel

wheel组 就类似于一个管理员的组, 只有属于wheel组的用户才可以用su登录为root。

**查看用户组**
cat /etc/group | grep [group_name]