1. 用户授权
create user test@'%' identified by 'mysql';
grant all privileges on testdb.* to test@'%';
flush privileges;
2. 远程上传授权
查询远程上传是否开启:
show global variables like 'local_infile';
远程上传授权:
set global local_infile=ON;
3. 远程登录启用
mysql -h127.0.0.1 -u test -p --local-infile=1 -D testdb
4. 远程上传数据
load data local infile 'D:/test/city.csv' into table city fields terminated by '&' lines terminated by '\n';