I'm trying to figure out how I can start using mysql through terminal since I'm not much of a fan for phpmyadmin.

I read online where that told me to type this into terminal

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

and I did and received this

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I've already setup the permissions through phpmyadmin

What can I be doing wrong, the guy in the tutorial didn't say that I had to include my login/pass anywhere in that link, I also did try including my login/pass and it still wouldn't work, it wouldn't execute, just display the help page for mysql.

What's a good third party application that would let me create tables, and work with MySQL? When I was using Windows I would use mysql maestro and it would do the job really well. Since I'm new to the Mac, what is out there?

  • What happens when you leave out the --host= part?
    – davethegr8
    Dec 3, 2009 at 0:59
  • The initial command actually works just fine for me: /Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot
    – GDP2
    May 9, 2019 at 20:10

6 Answers 6


Try --host= because the mysql client is trying to connect using the standard mysql socket (/tmp/mysql.sock). Specifying an IP address won't use this socket connection. I had to change this in every program to be able to connect to the MAMP database, including Sequel Pro.


I suggest using Sequel Pro for all your Mac SQL DB GUI needs.

As for why your access is deined,

  • Can you login to phpMyAdmin using root/root?
  • What happens when you leave off the --host= portion?

Just posted on Stack Overflow a solution for a similar problem. Thought it might help someone to post it here as well.

I was trying to access MAMP's MySQL through the terminal on Mountain Lion, and getting the same ERROR 1045 (28000).

The --no-defaults flag solved it for me.

/Applications/MAMP/Library/bin/mysql --no-defaults -u root -proot -h localhost

You should leave off the --host part or add --port=8889 but don't use just --host. By including --host without --port you might be trying to connect to another MySQL installation running at the default 3306.

It is possible that you changed the mysql root password during installation. Typing it this way will prompt you for your password, or you could enter the changed password as needed:

/Applications/MAMP/Library/bin/mysql -uroot -p

Also, Sequel Pro is one of the nicest free solutions for the Mac. I use it all the time. To connect to MAMP with Sequel Pro, use the following settings:


user name: root

password: root (or if you changed it, whatever that is)

port: 8889


Good luck, I tried to get MAMP to work and gave up on it. Nothing worked trying to get MySQL up and running on my machine until I installed XAMPP, which was surprisingly painless and trouble free. No additional configuration required once you have it set up, except for using its control panel application to start and stop the components you want to run at the moment.


This is an old thread, but I was trying to answer the same question. I have MAMP pro, Open MAMP and then the mysql tab. Uncheck the "allow local access only" checkbox that is about 1/2 way down the page. Restart your servers and voila!

You must log in to answer this question.