phpMyAdmin is a free web tool for managing MySQL databases from your browser. You can import and export databases, browse tables and run SQL queries without installing any software. This guide explains how to open phpMyAdmin in cPanel and DirectAdmin and how to use it for common tasks.
phpMyAdmin handles the contents and structure of a database. It does not create databases or database users. Those are set up in your control panel's MySQL database tools.
Before you start
You need to be logged in to your control panel. If you cannot log in, see the client area at https://my.hostking.host or contact support.
- Your database name, database username and password. These are listed in your welcome email or in the client area.
- An empty database and a database user with full privileges, if you are setting up a new database.
Open phpMyAdmin
cPanel
- Log in to cPanel.
- In the Databases section, click phpMyAdmin.
- Click a database name in the left sidebar, then click the plus sign (+) to show its tables.
You log in automatically with your cPanel details. You only see databases that belong to your account.
DirectAdmin
- Log in to DirectAdmin.
- Go to MySQL Management, then click phpMyAdmin.
- Enter the database username and password if you are asked for them.
On some DirectAdmin skins, the MySQL Management page has a phpMyAdmin SSO button. This logs you in without a separate password prompt. Menu names can vary, so check your own DirectAdmin screen.
Create a database and user
Create databases and users before you use phpMyAdmin. Use the MySQL database tools in your control panel.
cPanel
- In the Databases section, click MySQL® Databases.
- Under Create New Database, enter a name and click Create Database.
- Under MySQL Users, create a user with a strong password.
- Under Add User To Database, select the user and the database, then click Add.
- Tick ALL PRIVILEGES and click Make Changes.
DirectAdmin
- Go to MySQL Management.
- Click Create New Database and enter the details.
- To change what a user can do, click the database, then click Modify Permissions.
Grant only the privileges your application needs. For WordPress, check what the installer requires before you change permissions.
Import a database
cPanel
- Create an empty database in MySQL® Databases. Do not add any tables.
- Open phpMyAdmin and click the new database in the left sidebar.
- Click the Import tab.
- Click Choose File and select your
.sqlfile. You can also drag the file into the browser window. - Click Go.
phpMyAdmin also accepts compressed files named .sql.gz and .sql.zip.
When the import finishes, phpMyAdmin shows a confirmation and lists the tables it found. The tables appear in the left sidebar under the database name.
DirectAdmin
- Create an empty database in MySQL Management.
- Open phpMyAdmin and click the new database in the left sidebar.
- Click the Import tab.
- Choose your
.sqlfile and click Go.
Export a database
- In phpMyAdmin, click the database or table in the left sidebar.
- Click the Export tab.
- Choose an export method and format.
- Click Go and save the file to your computer.
Export a backup before making structural changes to a database.
Troubleshooting
- The database is not visible: check that it exists in MySQL® Databases (cPanel) or MySQL Management (DirectAdmin).
- Login fails: check the database username and password in MySQL Management, or reset the password in your control panel. If you change a password, update your application's configuration file too.
- Import fails: the user may not have full privileges on the database. phpMyAdmin reports any errors in the file.
- The file is too large: phpMyAdmin has an upload limit. For larger files, use the Backup Restore tool in cPanel or contact support.
If you need more help, use the live chat on the Hostking website or open a support ticket from the client area.
Always log out of your control panel when you use a shared or public computer.
