Mac – I just installed MAMP. How to access thesql through the terminal

macmampMySQLPHP

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?

Best Answer

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.

Related Question