MySQL Forums
Forum List  »  PHP

Failed to connect to your database server. The server reports the following message: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO).
Posted by: Scott Walters
Date: April 03, 2014 06:41PM

Hi-

I was setting up a project that was started on a Windows machine that uses Windows 8 on my Macbook Pro (late 2013 model) Mavericks OSX and encountered a PDO Exception.

PDOException: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO) in lock_may_be_available() (line 167 of /Applications/MAMP/htdocs/project-name/includes/lock.inc).

First, I was having an issue with mysql.sock file, but I think I fixed it. While doing so I think I may have somehow confused the connection to MAMP mysql because I can not establish a DB connect. mysqlite works fine. Below are the actions I took that led up to the problem.

After doing some research online I attempted a few things. I first tried redirecting mysql.sock as described in some literature I found on the internet. That did not work. I then deleted the mysql.sock redirect file since that wasn't the issue. I then searched by using, locate mysql.sock in terminal. Nothing was found. So I'm assuming I need to establish mysql.sock file again. BUT...I also read that if you uninstall and reinstall mysql that the mysql.sock should automatically replace itself in which it didn't. I tried starting a fresh drupal-7.26 project just to make sure it wasn't the project itself and got the same error. I have the correct settings in settings.php (drupal config file). I can connect to mac's DB, but I want to use MAMP. Any suggestions on how to fix this? Thanks.



Edited 1 time(s). Last edit at 04/03/2014 06:57PM by Scott Walters.

Options: ReplyQuote


Subject
Written By
Posted
Failed to connect to your database server. The server reports the following message: SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost' (using password: NO).
April 03, 2014 06:41PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.