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)


Submit an answer

This textbox defaults to using Markdown to format your answer.

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

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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