Export and import Database in MySQL

Export

mysqldump -u username -p database_name > dump_name.sql
  1. username is the username which will be used for export;
  2. database_name is the name of the database you want to export;
  3. dump_name.sql is the file name in the current directory that will store your dump;

Import

mysql -u username -p new_database < dump_name.sql