cancel
Showing results for 
Search instead for 
Did you mean: 

MySQL Access Denied despite correct authentication

SOLVED

MySQL Access Denied despite correct authentication

I've been following the documentation for Magento 2.3 and am now stuck while trying to set it up on the command line.  I'm executing the following:

 

 bin/magento setup:install --base-url=http://localhost/magento --db-host=localhost --db-name=magento --db-user=magento --db-password=[password] --backend-frontname=admin --admin-firstname=name --admin-lastname=name --admin-email=admin@test.com --admin-user=admin --admin-password=[password] --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

 

Obviously, in place of [password] I have my actual passwords.

 

I get the following response:

 

SQLSTATE[HY000] [1045] Access denied for user 'magento'@'localhost' (using password: YES)

This response would indicate that my user or password or database are incorrectly entered.  But they aren't.  I have checked my command many times, and am fully able to login with

mysql -u magento -p

with the same password.

 

What can I do?  What's going on?

 

 

magento_mysql_auth_issue.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: MySQL Access Denied despite correct authentication

I figured out the issue: I didn't escape the special characters in my password.

I was able to run the command successfully by adding a backslash before the special characters (! # ' " ` & ; and $).

View solution in original post

2 REPLIES 2

Re: MySQL Access Denied despite correct authentication

I figured out the issue: I didn't escape the special characters in my password.

I was able to run the command successfully by adding a backslash before the special characters (! # ' " ` & ; and $).

Re: MySQL Access Denied despite correct authentication

@matt_buckleyGood information Matt!

 

Problem solved? Please give 'Kudos' and accept 'Answer as Solution'.

- Tarandeep
Problem solved?Please give 'Kudos' and accept 'Answer as Solution'.