How to Import a MySQL Database using phpMyAdmin
In this tutorial, we will show you how to import a MySQL Database using phpMyAdmin. We'll assume that you've already exported your database, and it is either a .sql, zip, or tar.gz file. If you haven't read our previous article on how to export a database, please see How to Export a Database using phpMyAdmin.
- Log into cPanel
- To import a database, you'll first need to create the blank database. If you haven't already created the database, click the "MySQL Database Wizard" icon and follow the guide to create a database.
- Open phpMyAdmin by clicking the "phpMyAdmin" icon
- Select the database in the left menu that you will be working with
- Click "Import" in the top menu
- Under "File to Import", click "Browse" and select the backup file you previously created (it will be either a .sql .zip or .tar.gz file).
- Click "Go" at the bottom right
- When the database has been imported successfully, you should see a message at the top of the page similar to: Import has been successfully finished, ## queries executed.
Congratulations, you have just imported a database!
CREATE SCHEMA IF NOT EXISTS `DataBaseName` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; MySQL said: Documentation #1044 - Access denied for user 'userna5'@'localhost' to database 'DatabaseName'PhpMyAdmin does not allow you to CREATE databases due to security reasons. In order to get your SQL file to load you will need to remove the CREATE SCHEMA line at the beginning of your code. If you have any trouble please contact tech support.
Thank you for your feedback!