0

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$
user3207158
  • 619
  • 2
  • 5
  • 22
  • You used some `sudo rm` commands for what, exactly? Did you properly uninstall mysql before trying to re-install it? Also, it tells you the data directory already has files in it. – code_dredd Dec 01 '15 at 11:18
  • I did more than these two:sudo mv /etc/my.cnf /etc/my.cnf.bak AND rm *.err /usr/local/mysql/data/. They are from here http://coolestguidesontheplanet.com/mysql-error-server-quit-without-updating-pid-file/ – user3207158 Dec 01 '15 at 11:21
  • What is the proper way to uninstall mysql? Isn't it just brew uninstall mysql? – user3207158 Dec 01 '15 at 11:22
  • I'm a GNU/Linux, not a Mac, so I'm not familiar with `brew`, but it strikes me as a package manager; you should check docs to see if it supports a `remove` or `uninstall` option. Generally speaking, the package manager responsible for installation should be the same used to uninstall. Your `/usr/local/mysql/data/` directory probably contains files from your *first* successful installation and your attempt to reinstall is trying to avoid overwriting the files there. Try uninstalling MySQL, and then removing the `mysql/` directory (after creating backup!), then try reinstalling. – code_dredd Dec 01 '15 at 11:27

0 Answers0