0

I tried to follow valet installation with larval but I eventually gave up. It just wasn’t working with all my google powers.

I’ll just work with MAMP PRO. I got it working. I want to run some terminal commands and i’m trying to connect to mysql through terminal with MAMP PRO. Post Laravel Installation.

When I try

/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot

Error #2002 Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

Why is it even using a socket? I am running the mysql command directly.

When I try

mysql -u root 

This connects to a different version of mysql. I don’t know where this is located. And I dont see this alias in my .bash_profile

And when i run show databases; it doesn’t show me the database that match from sequel pro. I have two version of mysql on my computer.

There are alot of similar questions to this and they don't seem to work for me. I maybe because i removed some symlinks when I did the valat installation. I'm just lost

NaijaProgrammer
  • 2,813
  • 2
  • 19
  • 32
artSir
  • 410
  • 7
  • 27
  • MySQL listens on a port. Even if you run mysql through the command line it creates tries to connect via a socket. Chances are you've configured both MySQL installations to listen to the same port and therefore one of the two is failing to launch because the port is already in use. Check your configuration. – apokryfos Nov 06 '17 at 21:42
  • i did showvariables mysql returns a port of 3306 and in MAMP the port is listed on the UI Panel is 8889. So i guess they aren't on the same port, maybe there is a third mysql running – artSir Nov 07 '17 at 14:14

1 Answers1

0

The answer was here Error #2002 Can't connect to local MySQL server through socket '/Applications/MAMP/tmp/mysql/mysql.sock' (2)

the command

mysql -u root 

was link to another mysql so to link it to that run

sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /tmp/mysql.sock

now this works

mysql -u root 
artSir
  • 410
  • 7
  • 27