CSV
提前把csv文件格式準備好。
導入文件前查看mysql根目錄下的my.ini,查看secure_file_priv配置,導入的csv文件需要在該配置參數目錄下。可設置爲空後重啓服務器,導入文件就可以隨意放置。
use test;
set names utf8;
load data infile "your csv file path" into table tablename fields terminated by ','
Sql
use test;
set names utf8;
source d:/dbname.sql;//注意路徑反斜槓,通常與賦值的路徑相反,所欲大寫換小寫。