0

I get 'Error: Could not connect to MySQL server!' when I try to access the MAMP admin through a browser.

According the the MAMP application, mysql and Apache both start but sites that use databases and the MAMP admin are inaccessible.

I tried running:

/Applications/MAMP/Library/bin/mysqladmin -u root -p password NEWPASSWORD

and the feedback is:

/Applications/MAMP/Library/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: YES)'

Can anyone help me? How do I change the mysql password in MAMP?

LeoNerd
  • 8,344
  • 1
  • 29
  • 36
  • Have you changed the password or do you need the default? (default is apparently "" or `root` http://aralbalkan.com/760) – KCD Jun 26 '12 at 01:43
  • I tried both and it's neither. – Biff Webster Jr. Jun 26 '12 at 15:54
  • Not sure but you can read up on [access denied errors](http://dev.mysql.com/doc/refman/5.1/en/access-denied.html). Also note [MAMP doesn't have a my.cnf file](http://stackoverflow.com/questions/678645/does-mysql-included-with-mamp-not-include-a-config-file) by default. – KCD Jun 26 '12 at 21:39

1 Answers1

0

Your command should be like this -

mysqladmin -u root password NEWPASSWORD
Devart
  • 119,203
  • 23
  • 166
  • 186
  • That didn't work either. I get `mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists!` – Biff Webster Jr. Jun 26 '12 at 15:55
  • I have tried suggested command. It works, the password was changed. About new error, have a look at this documentation page - http://dev.mysql.com/doc/refman/5.1/en/can-not-connect-to-server.html – Devart Jun 27 '12 at 05:08