Development and databases
phpMyAdmin: manage, export and import databases
phpMyAdmin is the web tool for managing MySQL databases. You will find it in cPanel > Databases > phpMyAdmin and it lets you do everything with databases that already exist.
Creating, deleting or renaming a database is always done from cPanel > Manage My Databases (formerly MySQL® Databases). If you try it from phpMyAdmin, it will be refused.

What you can do
When you select a database in the left-hand column you can:
- Create, empty, modify or drop tables.
- View, create, edit and delete records (each table's Browse tab).
- Search for text in all tables at once (the database's Search tab).
- Run SQL queries (SQL tab).
- Import and export.
- Copy a database or a table to another one (Operations tab).
- Create triggers and events.

If you do not know which database your website uses, look at its configuration file: in WordPress it is DB_NAME in wp-config.php.
Be careful with two similar buttons: Empty deletes all the records in the table and Drop deletes the whole table. Neither can be undone.
Export a database
Select the database and open the Export tab. You will get a point-in-time copy in a file, in the format you choose (usually SQL).

There are two methods:
- Quick: standard settings, enough in most cases. Click Export (Go in older versions) and the
.sqlfile downloads. - Custom: lets you choose which tables to export, whether to include structure, data or both, and compress the file with
gziporzip(very useful for large databases).

Keep the file on your computer and do not leave it in a public folder on the website: it contains your customers' data and the application's passwords.
Import a database
The file can be .sql, or compressed as .gz or .zip.
- Create the database in cPanel > Manage My Databases and assign it a user with all privileges.
- Open phpMyAdmin and click that database in the left-hand column.
- Open the Import tab.
- Select the file and click Go (or Import).
Before importing, open the .sql file in an editor and look for CREATE DATABASE or USE nombre_base; lines at the beginning. Delete them: phpMyAdmin will not let you create the database and, if the file points to another database, it will fail.
Import into an empty database. If the file contains DROP TABLE, it will replace any existing tables with the same name.
If the file is too large
The maximum size is shown on the Import screen, next to the button for choosing the file. Compress the .sql file as .zip or .gz: since it is text, it usually takes up to 90% less space and uploads faster.
If it still does not fit, or the import stops halfway, import it from the terminal over SSH. Upload the file to the account (outside public_html) and run:
mysql -u usuario_bd -p nombre_bd < copia.sql
If it is compressed as .gz:
gunzip < copia.sql.gz | mysql -u usuario_bd -p nombre_bd
It will ask for the database user's password. If an import fails halfway, empty the database (or create it again) before trying again, so you do not duplicate data. For specific errors, see phpMyAdmin import or export failure.
Designer
Among the advanced options is the Designer, little known but very useful: it shows the tables and their relationships as a visual diagram and lets you design the database structure. You will find it in the database's More > Designer tab.

To duplicate a whole database, follow how to clone a database.
You may also find useful
- Check your MySQL version and compatibility Identify the actual version of the MySQL server your application uses, review compatibility and tell...
- Clone a database Duplicate a MySQL database by first creating the destination and its permissions in cPanel, then cop...
- Convert a MyISAM database to InnoDB by changing the storage engine Convert MyISAM tables to InnoDB on a verified clone, check space, indexes and rows, and keep the ori...
- Convert a database from utf8 to utf8mb4 Migrate tables from utf8 to utf8mb4 on a cloned database, checking collations and indexes and keepin...
Something wrong or out of date? Tell us and we will review it.