Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’

Run: brew info mysql

And follow the instructions. From the description in the formula:

Set up databases to run AS YOUR USER ACCOUNT with:
unset TMPDIR
mysql_install_db --verbose --user=`whoami` --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
To set up base tables in another folder, or use a different user to run
mysqld, view the help for mysql_install_db:
mysql_install_db --help
and view the MySQL documentation:
* http://dev.mysql.com/doc/refman/5.5/en/mysql-install-db.html
* http://dev.mysql.com/doc/refman/5.5/en/default-privileges.html

Hope this helps.

发表评论

电子邮件地址不会被公开。 必填项已用*标注