加入 --local-infile=1。。。
mysql -u XXXX -pYYYYY TableName --local-infile=1
另附解决方法
方法1 重新编译
./configure --prefix=/usr/local/mysql --enable-local-infile
make
make install
方法2 命令行直接执行
mysql -u [youruser] -h [youraddress] -p [yourpassword] [yourdatabase] --local-infile=1 -e "[yourcmd]"
ex:
mysql -uu10110013151 -h10.132.239.197 -p10110013151 u10110013151 --local-infile=1 -e "load data local infile '~/download/stu1.csv' into table stu fields terminated by ','; "