Question

Showing Error SQLSTATE[HY000] [1045] Access denied

I have gone through the tutorial and done the exact but my when I try to open in website it is showing Error!: SQLSTATE[HY000] [1045] Access denied for user ‘user’@‘localhost’ (using password: YES)

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi there @riyastp04,

Are you using the correct password for your connection string in your website configuration file?

Did you get any errors when you ran the CREATE USER query:

CREATE USER 'example_user'@'%' IDENTIFIED WITH mysql_native_password BY 'password';

Also, did you run the grant privileges query too:

GRANT ALL ON example_database.* TO 'example_user'@'%';

Regards, Bobby