Something really bad happened during the installation of MySQL on my Mac. I installed it for the first times and followed some sudo -rm commands, before things go south. I then installed it two more times but it doesn't work. Below is the terminal output. Please help. I'm desperate.
Lucass-MacBook-Pro-4:~ lucasyang$ brew install mysql
==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.9.yosemite.bottle
######################################################################## 100.0%
==> Pouring mysql-5.7.9.yosemite.bottle.1.tar.gz
==> /usr/local/Cellar/mysql/5.7.9/bin/mysqld --initialize-insecure --user=lucasy
Last 15 lines from /Users/lucasyang/Library/Logs/Homebrew/mysql/01.mysqld:
2015-12-01 05:02:43 -0600
/usr/local/Cellar/mysql/5.7.9/bin/mysqld
--initialize-insecure
--user=lucasyang
--basedir=/usr/local/Cellar/mysql/5.7.9
--datadir=/usr/local/var/mysql
--tmpdir=/tmp
2015-12-01T11:02:44.009593Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2015-12-01T11:02:44.009738Z 0 [Warning] 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes should be used with strict mode. They will be merged with strict mode in a future release.
2015-12-01T11:02:44.009743Z 0 [Warning] 'NO_AUTO_CREATE_USER' sql mode was not set.
2015-12-01T11:02:44.011537Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2015-12-01T11:02:44.011556Z 0 [ERROR] Aborting
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall mysql`
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
mysql_secure_installation
To connect run:
mysql -uroot
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents
Then to load mysql now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
Or, if you don't want/need launchctl, you can just run:
mysql.server start
==> Summary
/usr/local/Cellar/mysql/5.7.9: 12629 files, 464M
Lucass-MacBook-Pro-4:~ lucasyang$ mysql.server restart
ERROR! MySQL server PID file could not be found!
Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/var/mysql/Lucass-MacBook-Pro-4.local.pid).
Lucass-MacBook-Pro-4:~ lucasyang$