Report this

What is the reason for this report?

"Error establishing a database connection" - Wordpress Installation

Posted on September 6, 2021

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?



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!

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.

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

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.