mysqldump import code example
Example 1: linux command line import mysql database
mysql -u username -p -h dbhost dbname < filename.sql
Example 2: import database through command line
mysql -u username -p database_name < file.sql
Example 3: mysql dump restore
mysql -u [user] -p [database_name] < [filename].sql
Example 4: mysqldump
mysqldump -u [username] -p [database-to-dump] > [database-to-receive]
mysqldump -u [username] -P [port] -h [host] [database-to-dump] | mysql -u root -h 127.0.0.1 [database-to-receive]
mysqldump -u [username] -P [port] -h [host] [database-to-dump] [tabl1] [table2] [table3] | mysql -u root -h 127.0.0.1 [database-to-receive]
Example 5: install mysqldump
sudo apt-get install mysql-client
sudo apt-get install mariadb-clients
Example 6: import mysql database command line
Source : https:
open cmd
set mysql path in cmd
set path=c:\wamp\bin\mysql\mysql5.6.17\bin
For database import (Restore):
mysql -u YourUser -p YourDatabaseName < filename.sql