mysql -h localhost -u username -p database_name < backup_file.sql
# if your database is not locally hosted
mysql -u username -p -h dbhost dbname < filename.sql
mysql -u<user_name> -puser_password> <database_name>
source /path/db.sql
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;
USE yourdb;
SOURCE D:/My Folder with spaces/Folder/filetoimport.sql;
//go to the DB-Connection, create a new DB
//Right-Click on this DB, Choose Tools > Import. Than choose the .sql-file.