How to Find the Hostname of Your Database Server When Installing WordPress

How to Find the Hostname of Your Database Server When Installing WordPress

If you’re setting up a brand new installation of WordPress, you will need to know the value to put in your wp-config.php file for Database Host.

Be aware that this is not the same value for everyone who is installing WordPress. It’s unique to your hosting company.

Here’s an example of what we’re looking at:

{code type=php}define(‘DB_HOST’, ‘MyDatabaseHost’); // Example MySQL Database host{/code}

Most of the time the DB_HOST value is going to be localhost. However, it varies depending on your host. For example, DreamHost might have a value of mysql.example.com and 1and1 might have a value that looks something like this: db12345678. It depends on where your host stores the databases for your particular hosting account.

The WordPress codex has a list of possible values for a handful of hosting companies on the Editing wp-config.php page. If you’re not sure, just check your host’s documentation or contact tech support. They’ll be able to let you know the hostname for your database server.