Don P
Don P

Reputation: 63627

Install MySQL and create a database on Mac OS X Yosemite

I want to install MySQL on Mac OS X Yosemite, create a new user, then create a new database called "my_database". How can I do this?

What I've tried:

  1. From command line, brew install mysql. This succeeds and downloads MySQL to /usr/local/bin/mysql.

  2. Log into MySQL mysql -u root.

I get an error in Step 2:

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

I'm not sure how to fix this. I ran ps ax | grep mysql which showed no MySQL processes were running. Then I ran sudo /usr/local/bin/mysql start but I get the same ERROR 2002 (HY000): Can't connect to local MySQL ....

Upvotes: 5

Views: 6931

Answers (1)

glind
glind

Reputation: 63

You may need to update your path to the mysql socket.

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

I think this was already answered here: Mysql won't start after upgrading Mac OS X Yosemite (Mac OS 10.10)

Upvotes: 2

Related Questions