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
GoDaddy  Go to MySQL and edit the database to find the server name.
HostGator  localhost
HostICan  localhost
ICDSoft  localhost:/tmp/mysql5.sock
LaughingSquid  localhost
MediaTemple GridServer
MediaTemple (dv)  localhost
MegnaHost  localhost
NearlyFreeSpeech.Net  username.db  localhost
pair Networks
Rackspace Cloud
Yahoo  mysql
Hosts with cPanel  localhost
Hosts with Plesk  localhost
Hosts with DirectAdmin  localhost

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.

Sharing is Caring
Imtiaz Rayhan

Blogger, WordPress Enthusiast. I have few years of experiences with web hosting that I intend to share with others. Add me on Facebook

Click Here to Leave a Comment Below 13 comments

this is a lifesaver about ipage sql host name

shamsher khan blog

informative i was looking for the same on my server and found after reading your post.

Muhammad Ashar

When i try to direct access this url (username) its redirect me to If anyone have any suggestion kindly tell what should i do now?
here is my (username) is my database username.


    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 “”.

Rishi Sanuj

while setting Joomla configuration, this article save my day, thanks


Hi, you can add for “iPage:”

Charity Santos

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!!!!

I dont want to disclose my info THanks

iPage Database name is

Rohit Batra

Yeah hostnames of database server differs with hosting providers.. this is the main issue for newbie’s as they don’t know much tech stuff.


Nice info…once I have used local host while installing wordpress manually..


Was searching for iPage, but couldn’t find it either. Will contact technical support now..


Leave a Reply: