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]  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.