# export
mysqldump -u NAMAUSER -p NAMADATABASE > dbexport.sql
mysqldump -u NAMAUSER -p -h 172.23.0.3 NAMADATABASE > dbexport.sql # with host
# import
mysql -u NAMAUSER -p NAMADATABASE < dbexport.sql
mysql -u NAMAUSER -p -h 172.23.0.3 NAMADATABASE < dbexport.sql # with host
Source : https://www.programmingquest.com/2018/08/how-to-export-mysql-database-using.html
open cmd
set mysql path in cmd
set path=c:wampinmysqlmysql5.6.17in
For database import (Restore):
mysql -u YourUser -p YourDatabaseName < filename.sql
mysql>create database yourDatabaseName;
mysql>use yourDatabaseName;
mysql> create new_database;
mysql> use new_database;
mysql> source (Here you need to import the path of the SQL file);
E.g.:
mysql> source E:/test/dump.sql;
C:wampinmysqlmysql5.0.51bin>mysql -u root -p YourDatabaseName < YourFileName.sql
mysql> use db_name;
mysql> source backup-file.sql;
mysql -u database_user -p --default-character-set=utf8 [db_name] < database_file.sql