Error establishing a database connection

I haven’t touched my wordpress site in weeks and its been working fine. Now when I visit it I get: Error establishing a database connection

On both the site itself and the admin page of the site. Literally nothing has changed. My database credentials are exactly the same and are correct in the wp-config.php file

I have a 1gb droplet – should I add swap? Is that going to significantly decrease performance?

Any help would be greatly appreciated!

Show comments

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.

When I checked status it said stopped/waiting.

Restarting it gave me: <pre> start: Rejected send message, 1 matched rules; type=“method_call”, sender=“:1.106” (uid=1000 pid=32707 comm=“start mysql “) interface=“com.ubuntu.Upstart0_6.Job” member=“Start” error name=”(unset)” requested_reply=“0” destination=“com.ubuntu.Upstart” (uid=0 pid=1 comm=“/sbin/init”) </pre>

I had the same problem happen again today — now its not starting as quickly as before.

What can I do to my droplet to make sure I never run out of memory?

Hi you have to do the second step properly in this file… i had the same issue… <pre> mysql -u root -p

CREATE DATABASE your_database_name; CREATE USER database_user@localhost; SET PASSWORD FOR database_user@localhost= PASSWORD(“database_password”); GRANT ALL PRIVILEGES ON your_database_name.* TO database_user@localhost IDENTIFIED BY ‘database_password’; FLUSH PRIVILEGES; exit </pre>

do all off it step by step…You should get “Query OK, 0 rows affected (0.00 sec)” message each time. what i did wrong was, i forgot to enter my database name in grant permission command. hope it will help you.