前言 大家好吖,欢迎来到 YY 滴MySQL系列 ,热烈欢迎! 本章主要内容面向接触过C++ Linux的老铁 主要内容含:
Insert into tb test values(1,'Tom'),(2,'cat'),(3, jerry');
#客户端连接服务端时,加上参数--local-infile
mysql --local-infile -u root -p
#设置全局参数local infile为1,开启从本地加载文件导入数据的开关
set global local infile=1;
#执行load指令将准备好的数据,加载到表结构中
#逗号分隔,换行符截止
load data local infile '/root/sql1.log’ into table 'tb user’ fields terminated by ',’ lines terminated by '\n' ;