Accessing your database before DNS change

From DreamHost
Jump to: navigation, search

Overview

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 example.com: you can then create the subdomain "mysql.example.com" 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 dreamhosters.com 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 dreamhosters.com 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 “dhwiki.dreamhosters.com”.
    • The MySQL hostname is “mysql.dhwiki.dreamhosters.com”.


  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 mysql.dhwiki.dreamhosters.com.

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: