MySQL: Execute load DATA LOCAL error.
I use Navicat for MySQL to connect the MySQL server to perform local execution properly.
Show VARIABLES like '%local%infile% '
The results are as follows:
+---------------+-------+
| variable_name | Value |
+---------------+-------+
| Local_infile | On |
+---------------+-------+
1 row in Set (0.00 sec)
Use SECURECRT to connect to the MySQL server to perform
Load/usr/local/mysql/bin/mysql-uroot-h192.168.0.2-proot databasename-e "LOAD DATA local INFILE ' data.txt ' into table Test (Name,sex) "
On the error.
The error is as follows:
Error Line:sql:
LOAD DATA LOCAL INFILE "/opt/boco. DAL/NPM/ODBCTEMP/4101_11111/LOAD2DB/ECP_SMT.UNL "IGNORE into TABLE ecp_smt_11111-TERMINATED by";
Error, execute info:
LOAD DATA LOCAL INFILE The used command is not allowed with this MySQL version
There is no way to add--local-infile=1 in the MySQL command, did not expect the implementation of success.
The command is as follows:
/usr/local/mysql/bin/mysql-uroot-h192.168.0.2-proot databaseName--local-infile=1-e "LOAD DATA local infile ' Data.txt ' Into table test (name,sex) '
--local-infile=1 explains the following: whether to enable the server to support the load DATA local infile command.
By default, the server is supported. So by default the--local-infile=1.
So in general, the implementation of
/usr/local/mysql/bin/mysql-uroot-h192.168.0.2-proot databasename-e "LOAD DATA local INFILE ' data.txt ' into table test (Name,sex) "
Will not be an error.
If there is an error, the display plus--local--infile=1.
Over!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
This article is from the "SQL Server MySQL" blog, so be sure to keep this source http://dwchaoyue.blog.51cto.com/2826417/1408523