phpMyAdmin lets you export a database to a .sql file and import one back in. Use it to take a quick copy before making changes, or to move a site's database to or from EDZNET.
Open phpMyAdmin
- Log in to cPanel and go to Databases › phpMyAdmin. It opens in a new tab.
- In the left-hand list, click the database you want to work with. Always select the database first, otherwise the import or export runs at the wrong level.
Export a database
- With the database selected, click the Export tab.
- Leave Export method as Quick and Format as SQL.
- Click Export (or Go). Your browser downloads the
.sqlfile.
Choose Custom if you only want certain tables, or want the file compressed (gzip) to make it smaller.
Import a database
- Create an empty database and user first if you haven't already (see create a MySQL database and user).
- In phpMyAdmin, click the empty database in the left-hand list.
- Click the Import tab.
- Under File to import, click Choose File and select your
.sqlfile (or a compressed.sql.gzor.zip). - Leave the other options as they are and click Import (or Go). A green success message confirms it worked.
Troubleshooting
- File too large: the Import page shows the maximum upload size. Compress the file as
.sql.gz, which often shrinks it a lot. If it's still too big, open a support ticket and we'll advise on the best way to get it imported. - "No database selected": click the database in the left-hand list before opening the Import tab.
- "Table already exists": you're importing into a database that already holds those tables. Import into an empty database, or export with the Add DROP TABLE option ticked (under Custom).
- Site can't connect after the move: update the database name, user and password in your app's configuration. The host is
localhost.
To download a whole database without phpMyAdmin, use Files › Backup instead (see partial backups).