Importing and exporting databases is essential for migrating websites, restoring data, and creating backups. This guide covers importing and exporting MySQL databases using phpMyAdmin in Plesk.
Importing a Database via phpMyAdmin
- Log in to Plesk.
- Go to Databases.
- Click the database you want to import data into.
- Click Webadmin (phpMyAdmin).
- Click the Import tab.
- Click Choose File and select your
.sqlor.sql.gzbackup file. - Under Format, ensure SQL is selected.
- Click Go to start the import.
- Wait for the import to complete. A success message will appear.
Exporting a Database via phpMyAdmin
- In Plesk, go to Databases.
- Click the database you want to export.
- Click Webadmin (phpMyAdmin).
- Click the Export tab.
- Select Quick for a standard export, or Custom for more options (selecting specific tables, adding compression).
- Under Format, select SQL.
- Click Go. The database backup will be downloaded to your computer.
Importing a Database Using the Plesk Dump Tool
- In Plesk, go to Databases.
- Click the database name.
- Click Import Dump.
- Upload a
.sqldump file from your computer. - Click OK to import.
Important Notes
- Importing a database will overwrite existing tables with the same names.
- phpMyAdmin has an upload limit (typically 50 MB or higher). For larger databases, contact your hosting provider about importing via SSH.
- Always export a backup before importing new data.
- When migrating a database, ensure the character set matches (use utf8mb4 for modern applications).
Troubleshooting
"File too large" error during import:
- Compress the SQL file to
.sql.gzbefore importing. - Split the file into smaller chunks.
- Contact your hosting provider to increase the upload limit.
"SQL query error" during import:
- The SQL file may contain syntax errors or may be from a different MySQL version.
- Check the error message in phpMyAdmin for details.