Can't connect to local MySQL server through socket homebrew

后端 未结 21 1968
萌比男神i
萌比男神i 2020-12-04 05:54

I recently tried installing MySQL with homebrew (brew install mysql) and when I try to run it I get the following error:

ERROR 2002 (HY00

21条回答
  •  南笙
    南笙 (楼主)
    2020-12-04 06:18

    You'll need to run mysql_install_db - easiest way is if you're in the install directory:

    $ cd /usr/local/Cellar/mysql// 
    $ mysql_install_db
    

    Alternatively, you can feed mysql_install_db a basedir parameter like the following:

    $ mysql_install_db --basedir="$(brew --prefix mysql)"
    

提交回复
热议问题