mysql启动服务是提示如下
# mac
mysqld
2019-07-09T03:33:07.358428Z 0 [System] [MY-013169] [Server] /usr/local/Cellar/mysql/8.0.16/bin/mysqld (mysqld 8.0.16) initializing of server in progress as process 7935
2019-07-09T03:33:07.366198Z 0 [ERROR] [MY-010457] [Server] --initialize specified but the data directory has files in it. Aborting.
2019-07-09T03:33:07.366260Z 0 [ERROR] [MY-013236] [Server] Newly created data directory /data/mysql/ is unusable. You can safely remove it.
2019-07-09T03:33:07.366385Z 0 [ERROR] [MY-010119] [Server] Aborting
2019-07-09T03:33:07.366890Z 0 [System] [MY-010910] [Server] /usr/local/Cellar/mysql/8.0.16/bin/mysqld: Shutdown complete (mysqld 8.0.16) Homebrew.
方案一
/etc/my.cnf (brew的配置文件在/usr/local/etc/my.cnf) 文件中的datadir注释掉。
# datadir=/var/lib/mysql
很暴力的解决,使用默认的datadir目录,有mysql自动生成。
</