mysql secure-file-priv ='''
我有下一个问题:我想在表中插入图像(longblob)。首先,我成功地从c:\\ programData \\ mysql \\ mysql Server 8.0 \\ uploads
(secure-file-priv =“ c:\ programData \ mysql \ mysql \ mysql server) 8.0 \ uploads”),然后我设置了Secure-File-priv =“”,以便从任何位置插入图像,但插入了空值。我可以从任何位置上传图像吗?如果是这样,怎么样?
这是我的表:
,这是查询:
INSERT INTO `soccertrackerdev`.`test`(`id`,`image`)
VALUES(4, LOAD_FILE('C:/Users/ionut.puiu/Desktop/Untitled.png'));
运行查询后的消息是:
I have next problem: I want to insert in a table an image (LONGBLOB). First of all, I successfully inserted the image from C:\\ProgramData\\MySQL\\MySQL Server 8.0\\Uploads
(secure-file-priv = "C:\ProgramData\MySQL\MySQL Server 8.0\Uploads") and then I set secure-file-priv="" in order to insert images from any location but NULL value is inserted. Can I upload images from any location? If so, how?
This is my table:
And this is the query:
INSERT INTO `soccertrackerdev`.`test`(`id`,`image`)
VALUES(4, LOAD_FILE('C:/Users/ionut.puiu/Desktop/Untitled.png'));
And the message after run the query is:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您在INI文件中设置此时,MySQL开始遵守:(
在这种情况下,
local_infile
的设置无关紧要。)这必须是
empty
和在 docs :
如果空,则变量无效。这不是一个安全的设置。
如果设置为目录的名称,则服务器将导入操作限制为仅与该目录中的文件一起使用。目录必须存在;服务器不创建它。
如果设置为null,则服务器禁用导入和导出操作。
When you set this in your ini file, MySQL starts to obey:
(The setting for
local_infile
does not matter, in this case.)This must be the difference between
empty
andset to NULL
in the docs:If empty, the variable has no effect. This is not a secure setting.
If set to the name of a directory, the server limits import and export operations to work only with files in that directory. The directory must exist; the server does not create it.
If set to NULL, the server disables import and export operations.