--initialize specified but the data directory has files in it. Aborting
2016-06-30 15:26
573 查看
Mac用brew安装 mysql 报错
MacBook-Pro:mysql apple$ brew postinstall mysql ==> /usr/local/Cellar/mysql/5.7.12/bin/mysqld --initialize-insecure --user=apple Last 15 lines from /Users/apple/Library/Logs/Homebrew/mysql/01.mysqld: 2016-06-30 15:14:37 +0800 /usr/local/Cellar/mysql/5.7.12/bin/mysqld --initialize-insecure --user=apple --basedir=/usr/local/Cellar/mysql/5.7.12 --datadir=/usr/local/var/mysql --tmpdir=/tmp 2016-06-30T07:14:37.265699Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). 2016-06-30T07:14:37.267725Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting. 2016-06-30T07:14:37.267757Z 0 [ERROR] Aborting READ THIS: https://git.io/brew-troubleshooting If reporting this issue please do so at (not Homebrew/brew): https://github.com/Homebrew/homebrew-core/issues[/code]
解决方法
保证 --datadir目录为空。。 /usr/local/var/mysql 这个目录
我删除目录的内容 还是会自动生成,删除了这mysql然后马上执行brew postinstall mysql
然后奇迹出现了MacBook-Pro:mysql apple$ brew postinstall mysql ==> /usr/local/Cellar/mysql/5.7.12/bin/mysqld --initialize-insecure --user=apple --basedir=/usr/local/Cellar/mysql/5.7.1 MacBook-Pro:mysql apple$ mysql.server start Starting MySQL SUCCESS!
服务器也启动好了
自动生成原因可能是mysqld这个服务器已经启动。下次遇到可以试试 看活动监视器里有没有mysqld这个进程,有就Kill掉
相关文章推荐
- MySQL中的integer 数据类型
- MySQL存储过程
- mysql中int、bigint、smallint 和 tinyint的区别与长度
- mysql load data 导出、导入 csv
- source命令执行SQL脚本文件
- MySQL创建用户及权限控制
- MySQL管理数据表
- linux下mysql添加用户
- mysql procedure
- mysql触发器
- MySQL 备份和恢复策略
- 什么是Mac OS X?跟Linux有什么区别
- mac下安装mysql(转载)
- mysql 修改编码 Linux/Mac/Unix/通用(杜绝修改后无法启动的情况!)
- MySQL数据的导出、导入(mysql内部命令:mysqldump、mysql)
- mysql数据行转列
- Linux下修改MySQL编码的方法