I came across this problem when I converted to a Mac and I was trying to connect to a MySQL database on MAMP using CocoaMySQL. CocoaMySQL wasn’t able to connect to the database. Thought the solution may be useful to others.

Settings

Host:localhost
User:root
Password:root

If you try to connect now you may get the following error:
Unable to connect to host localhost.
Be sure that the address is correct and that you have the necessary privileges.
MySQL said: Access denied for user ‘root’@'localhost’ (using password: YES)

CocoaMySQL error

Solution

So here’s the extra bit. Enter the following in the socket field:
/applications/mamp/tmp/mysql/mysql.sock

Picture 30.png

Happy days!

Web Designire
Lee Munroe
About the author

Hi I'm Lee, a freelance web designer from Belfast Northern Ireland. Like this article? Feel free to follow me on Twitter.

Comments

Add a comment
  1. Gravatar

    Ah, yes I remember this form when I first setup MAMP/CocoaMySQL. Actually, I tend to use MySQL Tools’ Administrator and/or Query browser for my MySQL needs and don’t use CocoaMySQL but perhaps I should give it another whirl.

  2. Gravatar

    Thanks for the tip, CocoaMySQL (now Sequel Pro) works great, one question though, is it possible to connect to a MySQL database that´s not on my computer?

  3. Gravatar

    @JesperA: Yes you should be able to, as long as your host allows it

  4. Gravatar

    I have spent ages trying to figure this out. I put in my very specific google query with little hope of an answer and here it is! Thankyou thankyou thankyou!

  5. Gravatar

    thanks a million! That was just the information I needed…

Add a comment