How to fix "Error establishing a database connection" ?

Posted August 19, 2018 998 views

Can someone help me, this my site:
I really don’t know in digitalocean VPS.

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.

Submit an Answer
2 answers

Is there someone from digital ocean that will respond here or is it best to move to a server with tech support

This error is usually caused by incorrect username or password. Please make sure that you are supplying the correct credentials when connecting to your MySQL server.

Also, make sure that the user that is trying to access the database is granted the correct permissions using the syntax below:

GRANT ALL ON username.* TO 'db_name'@'localhost' ;