How to import a MySQL database (.sql file) and size limits
On this page
To move a website here, you import its database dump (a .sql file) into a new, empty database. phpMyAdmin handles files up to 512 MB; for larger files use the command line.
Before you start
- Create the database and user and add the user to the database.
- If the file contains
CREATE DATABASEorUSElines, remove them, or make sure they use your new database's full name (username_name). You cannot create databases from the import.
Import with phpMyAdmin (up to 512 MB)
- Log in to the control panel (
https://<server>:2083). - Open MySQL Databases (section Databases) and click Open phpMyAdmin.
- Click your database on the left.
- Open the Import tab.
- Click Choose file and select the
.sqlfile. A compressed.sql.gzor.zipuploads faster. - Click Import at the bottom.
phpMyAdmin shows "Import has been successfully finished" and the tables appear on the left.
Import a larger file over SSH
If your plan has shell access:
- Upload the file to your home folder with SFTP, for example as
~/backup.sql. - Open Terminal in the control panel, or connect with SSH.
- Run, with your own names:
mysql -u username_shop -p username_shop < ~/backup.sqlEnter the database user's password when asked.
For a compressed file:
gunzip < ~/backup.sql.gz | mysql -u username_shop -p username_shop
Delete the dump file afterwards; it takes disk space and contains your data.
Limits
| Method | Largest file | Time limit |
|---|---|---|
| phpMyAdmin | 512 MB per upload | 10 minutes |
mysql over SSH or Terminal | your disk space | none (Terminal: session limits apply) |
Common questions
The import fails with "#1044 - Access denied for user … to database …". Why?
The file tries to create or switch to a database with another name. Remove the CREATE DATABASE and USE lines from the file and import into your selected database.
The import stops with "#1062 Duplicate entry". What does that mean?
The database is not empty. Import into an empty database, or drop the existing tables first.
How do I import without shell access if the file is over 512 MB?
Split the dump into smaller files on your computer and import them one by one, or ask your hosting provider.
Thank you — this helps us improve the article.
Still stuck?
Ask the AI about your exact situation — it answers from this knowledge base — or contact us.
Related articles
- How to export a MySQL database (download a .sql backup)
Download a copy of a MySQL database as a .sql file with phpMyAdmin's Export tab or mysqldump over SSH, for backups or moving to another server.
- How to open phpMyAdmin to manage your MySQL databases
Open phpMyAdmin from the control panel with one click, without a database password, on its own port 2097, and what you can and cannot do there.
- How to create a MySQL database and database user
Create a MySQL (MariaDB) database and a database user in the control panel, add the user to the database, and get the details your website needs.
- MySQL connection details: host, port, socket and examples
The database host (localhost), port 3306, socket path, name and user format to connect WordPress, PHP, Laravel, Node.js or Python to MySQL, with examples.