Question

"Error establishing a database connection" - Wordpress Installation

Posted September 6, 2021 86 views
UbuntuWordPressLAMP StackUbuntu 20.04

I installed Wordpress on an Apache server, but when I go to the index.php file with my web browser, expecting to see the GUI for setting up WP, I get “Error establishing a database connection”. Can anyone point me in the right direction for straightening this out?

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

Hi @willjackson,

Have you configured the WordPress website’s Database? You’ll need to create an empty database, a database user and a password for that user. Once you do, when installing WordPress, you’ll need to put this information in the wizard. This should help with the problem.

If you let us what process you followed and when exactly you experienced the problem, we should be able to give you a more detailed response.

Hello, @willjackson

If you’re installing WordPress manually you can check our tutorial on How To Install WordPress on Ubuntu 20.04 with a LAMP Stack

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-on-ubuntu-20-04-with-a-lamp-stack

You’ll need to create a database and database user in step one and then complete the installation through the Web Interface

Also, you can quickly deploy a WordPress droplet using our Marketplace app:

https://marketplace.digitalocean.com/wordpress

https://www.digitalocean.com/community/tutorials/how-to-use-the-wordpress-one-click-install-on-digitalocean-2

Regards,
Alex

by Lisa Tagliaferri
WordPress is an extremely popular open-source technology and WordPress sites represent 36% of all websites that are currently online. This tutorial is intended for those who are comfortable with system administration or for those who are interested in learning how to administer your own WordPress instance on the server side. In this guide, we’ll install and set up WordPress via LAMP on a Linux Ubuntu 20.04 server.