This forum is no longer active. Please post your questions to our new community site

Forums MAMPStack

Error Logging in to mysql

Subscribe to Error Logging in to mysql 6 post(s), 2 voice(s)

 
Avatar Bill Johnson 3 post(s)

Whenever I try to login to mysql on my macbook I get this error:

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/Applications/mampstack-1.2-0/mysql/tmp/mysql.sock’ (2)

I was looking online and it was saying this error occurs because it’s looking for mysql.sock in the wrong location. I was going to edit the mysql.cnf file and change the location in the file to the correct location for mysql.sock but when I search for mysql.sock it isn’t showing up anywhere on my machine. I am new to this so any suggestions would be greatly appreciated. Thanks for your help.

Bill

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi Bill,

Is the MySQL database running? You can check it using this command in a Terminal:

$ cd
$ ./ctlscript.sh status

You can start it using:

$ ./ctlscript.sh start mysql

Cheers.

 
Avatar Bill Johnson 3 post(s)

Thank you Beltran, that was the problem but now I’m getting a different error:

ERROR 1045 (28000): Access denied for user ’snag49ers’@’localhost’ (using password: YES)

Not sure why I’m getting this. I’m using this command to login:

$ ./mysql -u wj1031 -p

Do I need to specify a host? I didn’t think I needed to since I’m using my local machine. Thanks again.

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi Bill,

You should use the “root” user to connect to MySQL:

$ mysql -u root -p

The password is the same that you set during the installation.

Cheers.

 
Avatar Bill Johnson 3 post(s)

Thanks again Beltran. Is there any way for me to edit something in a script that would start mysql automatically whenever i start my mac?

 
Avatar Beltrán Rueda Administrator 3,714 post(s)

Hi,

Yes, we wrote a post about how to install BitNami Stack as a service on OS X

https://bitnami.com/article/how-to-install-servi…

I hope it helps

Forums MAMPStack