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

The following problem in MySQL for Mac:

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

It’s solved by doing:

$ sudo chown -R _mysql /usr/local/var/mysql
$ sudo chmod -R o+rwx /usr/local/var/mysql
Anuncios

How to install brew in Mac

What is brew?

Homebrew installs the stuff you need that Apple didn’t. (source)

How to install

Open your terminal (You can use Spotlight Search, press command + space bar and type terminal then press enter).

Add the following code:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

And Finally press enter, the last code will install brew in your terminal just follow the steps.

To test the installation type the following:

brew info

You will get something like:

4 kegs, 14148 files, 1.1G