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
- SSH into your server as the system user of the app on which you’ll install phpMyAdmin.
- Change directory to the app’s web root directory.
Terminal window cd ~/apps/APPNAME/public - Download the phpMyAdmin archive.
Terminal window wget https://files.phpmyadmin.net/phpMyAdmin/5.2.2/phpMyAdmin-5.2.2-all-languages.zip - Extract the archive.
Terminal window unzip phpMyAdmin-5.2.2-all-languages.zip - Rename the extracted directory
from
phpMyAdmin-5.2.2-all-languages
tophpmyadmin
or any other name you prefer.Terminal window mv phpMyAdmin-5.2.2-all-languages phpmyadmin - In the extracted phpMyAdmin directory,
rename the file
config.sample.inc.php
toconfig.inc.php
.Terminal window mv phpmyadmin/config.sample.inc.php phpmyadmin/config.inc.php - In the extracted phpMyAdmin directory,
edit the file
config.inc.php
and locate the following line near the top of the file:Set the value of$cfg['blowfish_secret'] = ''; /* YOU MUST FILL THIS IN FOR COOKIE AUTH! */$cfg['blowfish_secret']
to a string containing 32 bytes of random data. For example, use the following random value generated by your browser:
- Download the phpMyAdmin archive: https://files.phpmyadmin.net/phpMyAdmin/5.2.2/phpMyAdmin-5.2.2-all-languages.zip
- Extract the phpMyAdmin archive.
- Rename the extracted directory
from
phpMyAdmin-5.2.2-all-languages
tophpmyadmin
or any other name you prefer. - Upload the phpMyAdmin directory to your app’s web root directory (
apps/APPNAME/public/
). - In the uploaded phpMyAdmin directory,
rename the file
config.sample.inc.php
toconfig.inc.php
. - In the uploaded phpMyAdmin directory,
edit the file
config.inc.php
and locate the following line near the top of the file:Set the value of$cfg['blowfish_secret'] = ''; /* YOU MUST FILL THIS IN FOR COOKIE AUTH! */$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
- Open your app’s phpMyAdmin directory in your browser.
- For Username, enter the name of the database user for the database you want to manage.
- For Password, enter the database user’s password.
- Click Log in.
Export a database
- Log into phpMyAdmin.
- Click on the name of the database to export on the side of the page.
- Click on Export at the top of the page.
- Click Export.
Import a database
- Log into phpMyAdmin.
- Click on the name of the database you’ll import into on the side of the page.
- Click on Import at the top of the page.
- Click Choose file.
- Select the
.sql
or.sql.gz
file on your local computer. - Click Import at the bottom of the page.