Before importing
- Create the database first in Account Manager then MySQL Management if it doesn’t exist. How to create a MySQL database in DirectAdmin
- Importing into a database that already has tables? Export it first as a safety copy. Tables with the same name are overwritten if the file contains
DROP TABLE, or cause “already exists” errors if not.
Steps
- Open Extra Features then phpMyAdmin.
- Select the target database in the left sidebar.
- Open Import.
- Choose your
.sqlor.sql.gzfile. - Leave the format as SQL and select Import.
A success message lists how many queries ran.
Common errors
| Error | Cause | Fix |
|---|---|---|
No database selected | Imported without selecting a database first | Select the database, then import |
#1044 Access denied ... to database 'oldname' | File contains CREATE DATABASE / USE oldname | Remove those lines from the file |
Unknown collation: 'utf8mb4_0900_ai_ci' | Exported from MySQL 8 | Replace with utf8mb4_unicode_ci (MySQL vs MariaDB: what’s the difference?) |
Table ... already exists | Target already has the tables | Drop existing tables, or import into an empty database |
| File too large / timeout | Above the upload or time limit | Importing a database that’s too large for phpMyAdmin |
After importing a website’s database
Update the application’s configuration with the new database name, user and password. How to change a database user’s password
Looking for somewhere to run PHP and MySQL? Traxio’s free PHP MySQL hosting includes phpMyAdmin and is free for your first 30 days.