Ask A Question


You’re not receiving notifications from this thread.

Setup MacOS 10.9 Mavericks Discussion

Chris Oliver asked in General

when I try this command: mysql -u root -p

Enter password:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


I tried to install mysql already three times. I even removed all packages with brew and started from scratch. Nothing works. I get a whole lot of unreadable errors when i tried to install mysql via brew. please help what to do: thank you.

here is the whole error report:

Last 15 lines from /Users/alexander/Library/Logs/Homebrew/mysql/post_install.01.mysqld:
2017-01-26 02:51:00 -0800


2017-01-26T10:51:00.896146Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-01-26T10:51:00.902385Z 0 [ERROR] --initialize specified but the data directory has files in it. Aborting.
2017-01-26T10:51:00.902439Z 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:

To connect run:
mysql -uroot

To have launchd start mysql now and restart at login:
brew services start mysql
Or, if you don't want/need a background service you can just run:
mysql.server start
==> Summary
🍺 /usr/local/Cellar/mysql/5.7.17: 14,226 files, 456.3M, built in 14 minutes


if someone has errors with db:rake not working, here is the solution:

Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 78,890+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2023 GoRails, LLC. All rights reserved.