Skip to content

Manage MySQL databases with phpMyAdmin

phpMyAdmin is a PHP application for managing, exporting, and importing MySQL databases through your browser.

A single installation of phpMyAdmin can be used to access multiple databases on the same server. You’ll log into phpMyAdmin using a database user’s credentials and phpMyAdmin will authenticate to MySQL using those same credentials.

Install phpMyAdmin

  1. SSH into your server as the system user of the app on which you’ll install phpMyAdmin.
  2. Change directory to the app’s web root directory.
    Terminal window
    cd ~/apps/APPNAME/public
  3. Download the phpMyAdmin archive.
    Terminal window
    wget https://files.phpmyadmin.net/phpMyAdmin/5.2.2/phpMyAdmin-5.2.2-all-languages.zip
  4. Extract the archive.
    Terminal window
    unzip phpMyAdmin-5.2.2-all-languages.zip
  5. Rename the extracted directory from phpMyAdmin-5.2.2-all-languages to phpmyadmin or any other name you prefer.
    Terminal window
    mv phpMyAdmin-5.2.2-all-languages phpmyadmin
  6. In the extracted phpMyAdmin directory, rename the file config.sample.inc.php to config.inc.php.
    Terminal window
    mv phpmyadmin/config.sample.inc.php phpmyadmin/config.inc.php
  7. In the extracted phpMyAdmin directory, edit the file config.inc.php and locate the following line near the top of the file:
    $cfg['blowfish_secret'] = ''; /* YOU MUST FILL THIS IN FOR COOKIE AUTH! */
    Set the value of $cfg['blowfish_secret'] to a string containing 32 bytes of random data. For example, use the following random value generated by your browser:
    
    
    

After installing phpMyAdmin, access phpMyAdmin in your browser using your app’s domain name and the name of the phpMyAdmin directory. For example, use https://DOMAIN/phpmyadmin if you named the directory phpmyadmin.

Log into phpMyAdmin

  1. Open your app’s phpMyAdmin directory in your browser.
  2. For Username, enter the name of the database user for the database you want to manage.
  3. For Password, enter the database user’s password.
  4. Click Log in.

Export a database

  1. Log into phpMyAdmin.
  2. Click on the name of the database to export on the side of the page.
  3. Click on Export at the top of the page.
  4. Click Export.

Import a database

  1. Log into phpMyAdmin.
  2. Click on the name of the database you’ll import into on the side of the page.
  3. Click on Import at the top of the page.
  4. Click Choose file.
  5. Select the .sql or .sql.gz file on your local computer.
  6. Click Import at the bottom of the page.