How To Find Hostname Of Your Database Server

Find Hostname Your Database Server

Database Hostname is often needed when you’re installing Content Management Systems, such as – WordPress, Joomla, Drupal etc.

If you don’t know what is Database Hostname, it refers to the physical location of your database. For your website to connect to your database, you need its hostname.

Here’s an example of how database hostname is used during WordPress installation. If you open wp-config.php file you can see this line,

define('DB_HOST', 'DatabaseHostHere'); // Sample MySQL Database Host

So in the place “DatabaseHostHere” you’ll be using your respective hostname, if you are using HostGator, you’ll be using “localhost” or  1and1 you’ll be using “db123123431” (sample numbers). It actually depends on where your host keeps your database.

Hostname of Database server, as you might be thinking, is not “localhost” for all, though “localhost” is used largely. Different hosts keep different names, and it is quite complicated to find hostname of the database server. So here, I gathered some Hosting Companies and their Database Hostname.

How to Find Hostname Of Database Server

Below I have mentioned some Hosting Companies and their respective DB_HOST values.

Hosting Company DB_HOST Value Guess
1and1  db12345678
AN Hosting  localhost
A Small Orange  localhost
BlueHost  localhost
DreamHost  mysql.example.com
GoDaddy  Go to MySQL and edit the database to find the server name.
HostGator  localhost
HostICan  localhost
ICDSoft  localhost:/tmp/mysql5.sock
IPower  username.ipowermysql.com
LaughingSquid  localhost
MediaTemple GridServer  internal-db.s44441.gridserver.com
MediaTemple (dv)  localhost
MegnaHost  localhost
NearlyFreeSpeech.Net  username.db
one.com  localhost
pair Networks  dbnnnx.pair.com
Rackspace Cloud  mysql50-01.wc1.dfw1.stabletransit.com
Yahoo  mysql
Hosts with cPanel  localhost
Hosts with Plesk  localhost
Hosts with DirectAdmin  localhost
Tophost.it  sql.your-domain-name.it

I took this table from WordPress Codex displaying the possible DB_HOST values. Remember different hosting companies use different network settings for their MySQL databases, so always be careful.

If you are still confused about finding your DB_HOST (Database Host) you can contact your Host’s Customer Support and they’ll help you with it.

Hope this helps you to find your Database Host. Don’t forget to share it with others. And let me know through comments if you face any difficulties finding your  hostname of Database server.

13 thoughts on “How To Find Hostname Of Your Database Server”

    1. I think you can’t directly access this url. It’s mainly if you are setting up any database you gotta provide access credentials, and there as DB_HOST you have to provide “username.ipagemysql.com”.

  1. ipage Data Name is unique – go to your cpanel – then mysql database – find the generate code column and hit the black board icon – that should give you your hostname. tada!!!!

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top