phpMyAdmin

From DreamHost
Jump to: navigation, search


Overview

phpMyAdmin is a free and open source website software package written in PHP intended to handle the administration of a database in a web browser.

Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, and so on) can be performed via the user interface in addition to having the ability to directly execute any SQL statement.

DreamHost provides phpMyAdmin for customers on shared, VPS, DreamPress, and Dedicated server hosting options. This article helps you access your databases using the DreamHost-managed phpMyAdmin software.

Prerequisites

Before you use phpMyAdmin at DreamHost, you must complete the following steps:

  1. Set up a domain for full or mirrored hosting on the (Panel > ‘Domains’ > ‘Manage Domains’) page. Redirect, parked, and cloaking options may not function properly.
  2. Do not enable Passenger on a hosted domain if you wish to access phpMyAdmin, as it intercepts the HTTP requests and will show an error.
  3. Add a MySQL hostname on the (Panel > ‘Goodies’ > ‘MySQL Databases’) page.
  4. Allow enough time after adding both the hostname and full hosting for DNS to propagate.

Once you complete these steps, phpMyAdmin will be available on your domain.

How to access phpMyAdmin

Finding your MySQL credentials

Every domain/subdomain hosted at DreamHost has phpMyAdmin configured to use HTTP authentication against the database server.

To access phpMyAdmin, you must have the following four pieces of information (collectively referred to as your MySQL credentials):

    • database name
    • username
    • password
    • hostname

To locate your MySQL credentials:

  1. Open the (Panel > 'Goodies' > 'MySQL Databases') page.
    The MySQL Databases page opens with a listing of your hostnames and databases.
    01 BackupMySQL db username.fw.png
    • Under the section titled ‘Database(s) on this server’ you’ll see a list of all of your databases.
    • To the right of the database, under the ‘Users with Access’ column is your MySQL username.
  2. Click the MySQL username. If more than one username is listed as having access to the database, you can pick any of them to log into that specific database.
    The users page opens:
    01 phpMyAdmin db user password.fw.png
  3. Click the Show button to obtain the user’s password.
    03 phpMyAdmin return button.fw.png
  4. On the top left of this page, click the Return to MySQL database listing button to return to the main ‘MySQL Databases’ page.
    04 phpMyAdmin hostnames.fw.png
    In the above image:
      • the first section on the MySQL Databases page lists your database hostnames.
      • it states “these are all interchangeable” – this means that you can access any of your databases on this account using any of your active hostnames.
      • both hostnames will work to open phpMyAdmin and connect to the database.

Logging in to phpMyAdmin

To open phpMyAdmin:

    05 phpMyAdmin hostname link.fw.png
  1. Click the hostname on your MySQL databases page. Or, copy/paste the URL of your MySQL hostname into your browser (e.g., mysql.example.com).
    A username and password prompt appear.
    04 BackupMysql phpmyadmin login.fw.png
  2. Enter the username and password you retrieved using the preceding ‘Finding your MySQL credentials’ section, and then click Go.
    Dh-kb-note-icon.fw.png Note: If none of your hostnames are working, visit the following article on how to access the database before your DNS updates:


How to export/import MySQL tables

The following steps outline how to copy a table from one MySQL database to another, and backup and restore a database.

Exporting a table

  1. Log into phpMyAdmin.
  2. Select the source database on the left pane.
  3. Select the table you wish to export on the left pane, under the database name.
  4. Click on the Export tab on the top right pane.
  5. Towards the bottom of the page, put a checkmark in the Save as file checkbox. This allows you to download it as a file, instead of dumping it into your browser window.
  6. Click the Go button on the bottom right to export the table.

Importing a table

  1. Log into phpMyAdmin.
  2. Select the destination database on the left pane.
  3. Click on the Import tab on the top right pane.
  4. Click Browse and locate the file with the .sql extension you saved earlier.
  5. Click OK and then the Go button on the bottom right to import the table.

The newly-imported table will appear in the list of tables.

How to backup/restore MySQL databases

phpMyAdmin is better situated for backing up and restoring smaller (< 5MB) databases only because of browser, PHP and other timeouts. If you have a larger database please consider working with MySQL via your shell account or the Account Backup feature in the control panel.

Backing up a database

  1. Log into phpMyAdmin.
  2. Select the source database on the left pane.
  3. Click on the Export tab on the top right pane.
  4. Towards the bottom of the page, put a checkmark in the Save as file checkbox. This allows you to download it as a file, instead of dumping it into your browser window.
  5. Click the Go button on the bottom right to export the database.

Restoring a database

  1. Log into phpMyAdmin.
  2. Select the destination database on the left pane.
  3. Click on the Import tab on the top right pane.
  4. Click Browse and locate the file with the .sql extension you saved earlier.
  5. Click OK and then the Go button on the bottom right to import the database.

If you wish to drop/delete a database

You cannot drop a database at DreamHost using phpMyAdmin; you can only delete a database on the (Panel > 'Goodies' > 'MySQL Databases') page.

See also