Home > database >  MySQL8 data into the problem
MySQL8 data into the problem

Time:10-02

Everyone a great god happy Mid-Autumn festival
A novice question, when I was in import CSV file to mysql,
Using data infile, prompted secure_file_priv problems

I use a centos 8 system, find to the default path for 'var/lib/mysql - files'
Because I don't want to get mysql restart, so don't go to modify my CNF file and select put I want to put the CSV var/lib/mysql - files under the
But the system continues to report errors..
Procedure is as follows:

Mysql> Show variables like "secure_file_priv";
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
Value | | Variable_name |
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
| secure_file_priv |/var/lib/mysql - files/|
+ -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - + -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- +
1 row in the set (0.01 SEC)

Mysql> The load data infile '/var/lib/mysql - files/master. Clientlist. CSV'
- & gt; Into the table agentcompany_compare
- & gt; Fields terminated by ', '
- & gt; Lines terminated by '\ n'
- & gt; Ignore 1 rows;
ERROR 1290 (HY000) : The MySQL server is running with The - secure - file - priv option so it always execute this statement

Close to collapse, beg you great god teach

CodePudding user response:

This can run, but what all can't write in

Mysql> The load data infile '/var/lib/mysql -
Files/clientlist CSV 'into table agentcompany_compare
- & gt; Fields terminated by ', '
- & gt; Lines terminated by '; \ n '
- & gt; Ignore 1 rows;
Query OK, 0 rows affected (0.01 SEC)
Does Records: 0:0 Skipped: 0 Warnings: 0

Have also tried other combinations:

Mysql> The load data infile '/var/lib/mysql -
Files/clientlist CSV 'into table agentcompany_compare
- & gt; Fields terminated by ', '
- & gt; Lines terminated by '; \ n ';
ERROR 1300 (HY000) : Invalid utf8mb4 character string:
'idagentcompany acid acname actel acaddress
Logo
1 1
"'

Mysql> The load data infile '/var/lib/mysql -
Files/clientlist CSV 'into table agentcompany_compare
- & gt; Fields terminated by ', '
- & gt; Lines terminated by '\ r \ n';
ERROR 1366 (HY000) : Incorrect integer value:
'idagentcompany acid acname actel acaddress
Logo 'for column' idagentcompany 'at row 1
  • Related