0

I'm trying to install Magento 2.3.1 locally, and I keep running into this error when I adding the database. The problem is not the credentials. Everything I've read about this error implies it's a problem with the database name, user, or password. I've tried different databases and users - with and without passwords - and get the same result each time.

I was able to install Magento 2 once after uninstalling and reinstalling MAMP Pro. Then, I updated my PC, and the site was no longer working. Instead there was an error message telling me to view the details in the exceptions log. This is roughly how the first line of that log file said:

main.CRITICAL: exception 'PDOException' with message 'SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES)

I deleted those site files and tried installing Magento again, and I was back to getting that error message. I don't know what else to try. I'm not reinstalling MAMP Pro every time I restart my computer.

I have a somewhat unusual setup in that I use Windows 10 with MAMP Pro 4. I don't know if that has something to do with it.

1 Answer 1

1

It looks like I had 2 versions of MySQL installed on my computer: MySQL by itself along with the one that's included with MAMP Pro, and the standalone version was occupying port 3306. So, even though the databases were set up correctly through MAMP and phpMyAdmin, it wasn't working because Magento was looking for the databases in the other MySQL program.

I uninstalled the standalone program and made sure the MAMP Pro version was using port 3306 (it had switched to 3307 because the other port was occupied). After that, I was able to install Magento 2 with no issues.

So, if anyone else happens to run into this error message despite being certain there's nothing wrong with the database or password, make sure you don't have MySQL installed anywhere else on your machine and that it's using port 3306.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.