After publishing a post, my website displays Error Establishing Database Connection


followed the instructions on here to install Wordpress on Ubuntu 12.04. However whenever I publish a post my site goes down and I’m left with an Error Establishing Database Connection message. I can get rid of it by typing ‘sudo server mysql restart’ in putty, but having to do this after every post is getting rather tedious.

Has anybody encountered this before, or know of a way in which I can fix? Cheers

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.

I finally got it working. It was a simple password error. <br> <br>When doing this: <br>SET PASSWORD FOR wordpressuser@localhost= PASSWORD(“password”); <br> <br>and this: <br>GRANT ALL PRIVILEGES ON wordpress.* TO wordpressuser@localhost IDENTIFIED BY ‘password’; <br> <br>make sure the “password” strings on both lines are the same. I made the mistake of only putting my secure password in the first command and not the second. I re-ran the commands with the passwords in both commands and it’s working now.

Yes, I have.

@Dillon, <br> <br>Have you tried rebooting your droplet?