Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
What happens when you leave out the --host= part? –  davethegr8 Dec 3 '09 at 0:59
add comment

6 Answers

Try --host=127.0.0.1 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.

share|improve this answer
add comment

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?
share|improve this answer
add comment

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
share|improve this answer
add comment

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:

host: 127.0.0.1

user name: root

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

port: 8889

share|improve this answer
add comment

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.

share|improve this answer
add comment

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!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.