MySQL数据导入与安全文件私密问题
我有一个关于MySQL数据导入的新手问题 我试图将一个.csv文件导入我的MySQL数据库,然后出现了“secure_file_priv”错误,我花了一整天的时间在google上尝试,我发现secure_file_priv的值是“/var/lib/MySQL files”,因为我使用的是Centos 8。我将csv文件放入目录中,但它始终显示相同的错误 我的代码:MySQL数据导入与安全文件私密问题,mysql,centos,Mysql,Centos,我有一个关于MySQL数据导入的新手问题 我试图将一个.csv文件导入我的MySQL数据库,然后出现了“secure_file_priv”错误,我花了一整天的时间在google上尝试,我发现secure_file_priv的值是“/var/lib/MySQL files”,因为我使用的是Centos 8。我将csv文件放入目录中,但它始终显示相同的错误 我的代码: mysql> show variables like "secure_file_priv"; +-----
mysql> show variables like "secure_file_priv";
+------------------+-----------------------+
| Variable_name | Value |
+------------------+-----------------------+
| secure_file_priv | /var/lib/mysql-files/ |
+------------------+-----------------------+
1 row in set (0.01 sec)
mysql> load data infile '/var/lib/mysql-files/master.clientlist.csv'
-> into table agentcompany_compare
-> fields terminated by ','
-> lines terminated by '\n'
-> ignore 1 rows;
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv
option so it cannot execute this statement
新进展:
我没有线索,但它“工作”,但没有数据正确写入mysql,请看我的代码:
mysql> load data infile '/var/lib/mysql-
files/clientlist.csv' into table agentcompany_compare
-> fields terminated by ','
-> lines terminated by ';\n'
-> ignore 1 rows;
Query OK, 0 rows affected (0.01 sec)
Records: 0 Deleted: 0 Skipped: 0 Warnings: 0
我已经尝试了很多,供您参考:
mysql> load data infile '/var/lib/mysql-
files/clientlist.csv' into table agentcompany_compare
-> fields terminated by ','
-> lines terminated by ';\n';
ERROR 1300 (HY000): Invalid utf8mb4 character string:
'idagentcompany acid acname actel acaddress
logo
1 1 "
'
mysql> load data infile '/var/lib/mysql-
files/clientlist.csv' into table agentcompany_compare
-> fields terminated by ','
-> lines terminated by '\r\n';
ERROR 1366 (HY000): Incorrect integer value:
'idagentcompany acid acname actel acaddress
logo' for column 'idagentcompany' at row 1
难题。设置显示“文件”,代码显示“文件”
/var/lib/mysql files/
不等于“\var\lib\mysql file`slash vs back-slash'var/lib/mysql files/master.clientlist.csv”\35;非常感谢您指出语法,但它仍然不起作用。。同样的错误我已经用outfile测试过了,它工作得很好,但不是用Infle,阅读谷歌的每一篇文章仍然没有任何线索。好吧,看来我现在开始了,现在它说我没有正确的整数值,如果我解决了它,我会不断更新。