How to fix "Error establishing a database connection" ?

August 19, 2018 580 views
CentOS DigitalOcean

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

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' ; 
Have another answer? Share your knowledge.

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