import sql via command code example
Example 1: mysql import from sql file
mysql -u username -p database_name < file.sql
; OR
mysql> use db_name;
mysql> source file_name.sql;
Example 2: import sql via command line
mysql> use db_name;
mysql> SET autocommit=0 ; source the_sql_file.sql ; COMMIT ;
Example 3: how to import mysql database command line
mysql>create database yourDatabaseName;
mysql>use yourDatabaseName;
Example 4: import sql files
use DATABASE_NAME
source SQL_FILE_PATH
e.g.
use test
source c: