I’m importing my database to a discourse instance on a local environment, and need to connect to my wp database remotely.

@client = Mysql2::Client.new(
host: "REMOTE_HOST_NAME",
username: "DB_USERNAME",
password: "MY_SECURE_PASSWORD",
database: "DB_NAME",
)

I know the un, pw etc, but I can’t figure out what the remote host name would be.

Any ideas?

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

Hello there,

Database Host – The hostname of your Database Server. A port number, Unix socket file path or pipe may be needed as well.

If the database you want to use is hosted on the same server/droplet you can put the following line in the wp-config.php

  • host: "localhost",

If the database is hosted externally you can enter the IP of the remote server, followed by the port of the MySQL instance.

Hope that this helps!
Regards,
Alex