Export and import Mysql database with large datas needs alots of time with phpmyadmin. Sometimes failed to import because some errors. Fortunately, there is a simple way to do that, directly from command line with mysqldump.

Export Mysql Database

Example:
I want to export my database: exampledb.sql with username: myuserdata and password: mypassword and export to directory /home/website/public_html:

mysqldump -u myuserdata -p exampledb > /home/website/public_html/exampledb.sql

Import Mysql Database

Then, create empty database with different username:

mysql -u root -p

Insert root password and create empty database:

Example: new empty databasename exampledb2, username: myuserdata2 and password mypassword2

create database exampledb2;
GRANT ALL ON exampledb2.* TO [email protected] IDENTIFIED BY 'mypassword2';

And exit, with command:

quit;

Now, import database:

mysql -u myserdata2 -p exampledb2 < /home/website/public_html/exampledb.sql

Insert password from previous step. Wait for a moment, and the database will completely import with very quick.**