MySQL: Execute load DATA LOCAL error

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.