Accessing your database before DNS change

From DreamHost
Jump to: navigation, search


To access your MySQL database, you need a unique hostname (domain name) or IP address for your MySQL server. This hostname can be any name you wish, so long as you have registered it, but it is commonly a subdomain of your primary domain and is named "mysql.example.TLD". For example, let’s say your domain is you can then create the subdomain "" which is used to connect to your database server.

This arrangement is convenient to use with DreamHost's MySQL installations, as you can create and manage all of your databases from the (Panel > 'Goodies' > 'MySQL Databases') page.

However, during a server or web host migration, the DNS for "example.tld" may not point to DreamHost's nameservers, so you won't be able to use a subdomain of "example.tld" for the MySQL hostname.

With DreamHost's setup, your MySQL server (which hosts all of your databases) is accessible from any subdomain that you assign to it within your DreamHost account. Thus, you can still access any of your DreamHost-hosted MySQL databases by creating a temporary MySQL subdomain within your panel.

How to connect with a temporary MySQL hostname

As stated above, you can access your database while the DNS of your primary site is not pointed to DreamHost. This requires three steps:

  1. Create a subdomain.
  2. Using that subdomain, create a MySQL hostname.
  3. Use this MySQL hostname to access your database via phpMyAdmin.

Step one: Adding a dreamhosters subdomain

Add a free subdomain that mirrors your primary domain on the (Panel > 'Domains' > 'Manage Domains') page.

For more detailed instructions about this process, please view the following article:

Step two: Adding a MySQL hostname

To add a hostname for your new subdomain:

  1. Navigate to the (Panel > 'Goodies' > 'MySQL Databases') page.
    The MySQL Databases page opens:
    Accessing your Database add hostname.fw.png
  2. Click the Add New Hostname button.
    The ‘Add a MySQL Hostname’ page opens:
    Accessing your Database create hostname.fw.png
    Dh-kb-note-icon.fw.png Note: In the above example:
    • The primary domain is “”.
    • The MySQL hostname is “”.

  3. Enter the hostname prefix of your choice (commonly "mysql"), and then select the new subdomain using the dropdown menu.
  4. Click the blue Create this MySQL hostname now! button to finish.

Step three: Accessing your database with phpMyAdmin

Once the DNS changes propagate (which may take anywhere from 4 to 24 hours), you are then able to access the phpMyAdmin MySQL management utility using the mysql hostname you just created. In the example above, it would be

If you try to access phpMyAdmin before the MySQL hostname's DNS records are updated, DreamHost's phpMyAdmin interface is unable to recognize your login information.

For further information about phpMyAdmin and how to log in, please view the following article:

How to connect with an internal URL

If you need to access phpMyAdmin immediately and aren’t familiar with how to modify your local computer’s hosts file, you can access your database using a temporary URL.

Here's how you do it:

  1. Find the data center for your database.
  2. Find your database server name.
  3. Compose the URL.

Step one: Identifying in which data center your databases are hosted

You can do this on the (Panel > 'Support' > 'Data Centers') page:

Accessing DB before DNS Change datacenter.fw.png

The data center your databases are hosted in determines which of the following four base URLs you’re going to use:

Data Center Base URL
US - West (Los Angeles, CA)
US - West (Irvine, CA)
US - East (Ashburn, Virginia)
US - West (Hillsboro, Oregon)

The example image above states that the database is in the Irvine, CA data center, so you'd start with the first part of the URL:

  • “”.

Step two: Finding the full name of your MySQL server

You can do this on the (Panel > 'Goodies' > 'MySQL Databases') page:

Accessing DB before DNS Change SQL servername.fw.png

Internally, the hostname for your MySQL server is translated from SERVER:SERVICE into So in the example image, "turkeyfish:overholtzer" is translated to ‘’.

A note for VPS/DreamPress/Dedicated servers

If the database you're trying to access is on a MySQL VPS, DreamPress, or a Dedicated Server, your MySQL server has a different internal hostname:

Accessing DB before DNS Change VPS servername.fw.png
  • MySQL VPS =
Accessing DB before DNS Change DP servername.fw.png
  • DreamPress =
Accessing DB before DNS Change DED servername.fw.png
  • Dedicated Server =

Step three: Composing the URL

The last step is to compose the URL by appending the internal hostname from step two to the base from step one.

Using the images from the last two steps, the following is URL is created:

When you enter this URL, a MySQL login prompt appears. You can now log in to phpMyAdmin and import your database.

Additional examples for VPS/DreamPress/Dedicated Servers:

Dedicated Server