本文介绍了MySQL的"secure-file-priv"不允许从文件中加载数据,即使是从分配的安全文件夹中也是如此的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将大型.csv文件上传到MySQL上的数据库中(而不是在服务器上,仅在本地计算机上供我使用).我一直遇到错误代码:1290.MySQL服务器正在使用--secure-file-priv选项运行,因此它无法执行抛出此错误的语句.

I am trying to upload a large .csv file into a database (not on a server, just on my local computer only for my use) on MySQL. I have been having the Error Code: 1290. The MySQL server is running with the --secure-file-priv option so it cannot execute this statement error thrown.

我将我的.csv文件放入我"文件中指定的指定安全"文件夹(C:/ProgramData/MySQL/MySQL Server 5.7/Uploads)中,但它始终给我同样的错误.我见过的每个解决方案都在使用该文件夹目标,并且由于该方法不起作用,任何人都可以帮助我解决或关闭secure-file-priv选项吗?

I put my .csv file into the specified 'safe' folder (C:/ProgramData/MySQL/MySQL Server 5.7/Uploads) specified in the 'my' file, but it kept giving me the same error. Every solution I've seen has been using that folder destination and since that doesn't work can anyone help me get around or turn off the secure-file-priv option?

这是我的代码,以防万一:

Here is my code in case wanted:

LOAD DATA INFILE 'C:\ProgramData\MySQL\MySQL Server 5.7\Uploads\my-file.csv'
INTO TABLE my-table
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

谢谢您的帮助

推荐答案

从MySQL 文档获取LOAD DATA INFILE:

From the MySQL documentation for LOAD DATA INFILE:

LOAD DATA INFILE "C:/ProgramData/MySQL/MySQL Server 5.7/Uploads/my-file.csv"
INTO TABLE my-table
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n'
IGNORE 1 ROWS;

这篇关于MySQL的"secure-file-priv"不允许从文件中加载数据,即使是从分配的安全文件夹中也是如此的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-03 13:57