I'm all very new to mySQL. I've installed it from the Oracle website, and I think I managed to run the server with the command:

sudo ./mysqld_safe --console

But it's impossible to open the client and have the "mysql>" prompt that nobody else seems to have a hard time having. I tried:

  • ./mysql
  • ./mysql -u root -p
  • ./mysql -u root -p root
  • ./mysql -u myusername

etc...(I also tried with 'sudo' first)

I always get the same message:

ERROR 1045 (28000): Access denied for user 'xxxxx'@'localhost' (using password: XX)

As you see, I don't really know what I'm doing. Any tips?

  • Given this is more about MySQL than Mac, try asking over on dba.stackexchange.com – they specialise on database set up and administration. Hopefully someone there will be better able to help identify this error message. Jan 21, 2016 at 10:13

2 Answers 2


Post Install Set-up

Have you been through the post installation set up?

In particular, Securing the Initial MySQL Accounts is important because it sets up the default users and passwords.


You may want to try installing MySQL via the homebrew project. With brew installed, you can install MySQL using the command:

brew install mysql


Alternatively, MAMP offers an application based edition of MySQL. Launching the application starts a preconfigured copy of MySQL for you – and it includes the web-based myphpadmin.

With regard to your comment wanting a free solution, MAMP is free:

Similar to a Linux-Distribution, MAMP is a combination of free software and thus it is offered free of charge. MAMP is released under the GNU General Public License and may thereby be distributed freely within the boundaries of this license.

  • Ok thanks, I did not see that one. I went through it and tried, as they say, to type "./mysql -u root" but still got the same error msg. Actually it's weird, because it's written that I should type "mysql ..." (without the "./") but that does not work ("command not found") Jan 21, 2016 at 9:54
  • I also tried with brew: After installation, I could run the "mysql -uroot" command, as they suggest, and still got the same error msg... Jan 21, 2016 at 10:04
  • Actually I still got this error msg even if the server is not running. I have no idea what to do... Jan 21, 2016 at 10:12
  • 1
    Have you tried MAMP? Jan 21, 2016 at 10:14
  • I am looking for a free solution Jan 21, 2016 at 10:28

See what the path is to MySQL and make sure there isn't another installation conflicting with the one installed by composer. In terminal:

nano ~/.bash_profile

You might see something like:

export PATH="/usr/local/mysql/bin:$PATH"

You can reset the root password once you know where to call mysql from:

/path/to/mysql/bin/mysqladmin -u root password [yourpasswordhere]

My path to MySQL is /usr/local/mysql/bin/mysqladmin

What Operating system are you running? I used to use MAMP but I didn't care for it. I prefer to set up my own LAMP stack (Linux, Apache, MySQl, PHP) using the details outlined in this tutorial:


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .