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:

define('DB_HOST', 'MyDatabaseHost'); // Example MySQL Database host

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.

FREE EBOOK
Your step-by-step roadmap to a profitable web dev business. From landing more clients to scaling like crazy.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

FREE EBOOK
Plan, build, and launch your next WP site without a hitch. Our checklist makes the process easy and repeatable.

By downloading this ebook I consent to occasionally receive emails from WPMU DEV.
We keep your email 100% private and do not spam.

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.

Tags: