Question

How to connect a one click install wordpress to a database on one click install phpmyadmin droplet

Posted February 27, 2021 547 views
WordPress

I have a one-click install phpmyadmin droplet with the database I want my wordpress to use. My wordpress is a one-click install as well.

I’m tryign to edit the wp-config.php file with the database credentials. What would the hostname be for my case? Is it phpmyadmin droplet’s ip address with port number example 123.456.789:3306?

I can’t seem to get the “error establishing database connection”

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
1 answer

Hi there,

In order to be able to do that you would need to configure your MySQL server to accept external connections as per this tutorial here:

https://www.digitalocean.com/community/tutorials/how-to-allow-remote-access-to-mysql

As an alternative, I could suggest installing PHPmyAdmin on your WordPress Droplet manually as described here:

https://www.digitalocean.com/community/questions/how-to-install-manually-phpmyadmin-on-ubuntu

That way you will not have to open the MySQL service for external connections.

Hope that this helps.
Regards,
Bobby

by Mark Drake
Many websites and applications start off with their web server and database backend hosted on the same machine. With time, though, a setup like this can become cumbersome and difficult to scale. A common solution is to separate these functions by setting up a remote database, allowing the server...
  • Hi there!

    I have already followed those steps. I can connect to the mysql database from the remote server using mysql -u user -h databaseserverip -p command. It must be my wordpress wp-config.php file? Im still getting “Error establishing a database connection”

    • Hi there,

      Yes indeed, as you are able to connect with the mysql command it means that you’ve configured the MySQL server correctly.

      What is the MySQL version that you are using? If it is MySQL 8, then you might have to create a user with mysql_native_password.

      Regards,
      Bobby