olv53
olv53

Reputation: 73

Setting up Laravel Valet Mysql issues

I am trying to install Laravel Valet on MAcOSX High Sierra. I have followed the instructions on the Valet homepage, installed homebrew, php 7.3, [email protected]. I have to use sudo when running brew services start.

The error I get is: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

I have tried sudo brew services restart [email protected]

I have tried reinstalling Valet.

I have added [email protected] to my path.

If I run brew info [email protected]:

[email protected]: stable 5.7.28 (bottled) [keg-only]
Open source relational database management system
https://dev.mysql.com/doc/refman/5.7/en/
/usr/local/Cellar/[email protected]/5.7.28 (319 files, 235.3MB) *
  Poured from bottle on 2019-10-15 at 10:09:30
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/[email protected]
==> Dependencies
Build: cmake ✘
Required: [email protected] ✔
==> Caveats
We've installed your MySQL database without a root password. To secure it run:
    mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run:
    mysql -uroot

[email protected] is keg-only, which means it was not symlinked into /usr/local,
because this is an alternate version of another formula.

If you need to have [email protected] first in your PATH run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.bash_profile

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

For pkg-config to find [email protected] you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"


To have launchd start [email protected] now and restart at login:
  brew services start [email protected]
Or, if you don't want/need a background service you can just run:
  /usr/local/opt/[email protected]/bin/mysql.server start
==> Analytics
install: 22,455 (30 days), 70,097 (90 days), 260,848 (365 days)
install_on_request: 22,327 (30 days), 69,830 (90 days), 260,028 (365 days)
build_error: 0 (30 days)

It would be much appreciated if someone could point me in the right direction of how to fix this. I realise similar questions have been asked but I have been trying forever but nothing I've seen posted works. I think I need to completely remove mysql versions but I have both mysql, [email protected] and [email protected] and feel like it is impossible to start over.

Upvotes: 0

Views: 2262

Answers (1)

Eldar Gadirov
Eldar Gadirov

Reputation: 21

First, in your terminal try to check:

 type -a mysql

If everything is done right, you will see

mysql is /usr/local/bin/mysql

Then try to run:

sudo mysql.server start

Upvotes: 2

Related Questions