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

前端 未结 30 1349
南旧
南旧 2020-12-04 05:14

I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error:

30条回答
  •  猫巷女王i
    2020-12-04 06:01

    As others have pointed out this is because MySQL is installed but the service isn't running. There are many ways to start the MySQL service and what worked for me is the below.

    To start the service:

    1. Go to "System Preference"
    2. At the bottom pane there should be MySql icon.
    3. Double click that to launch the 'MySQL Server Status' and press the button 'Start MySQL Server'

    My env:

    Mac Yosemite 10.10.3

    Installed Package: /Volumes/mysql-advanced-5.6.24-osx10.8-x86_64

提交回复
热议问题