gpt4 book ai didi

mysql - 如何在MySQL中插入图像?

转载 作者:行者123 更新时间:2023-11-29 03:19:26 24 4
gpt4 key购买 nike

I used these lines of code but in the table it is showing null

create table Picture( imageID integer primary key, image blob);
insert into Picture values(1, LOAD_FILE('D:\\flower.gif'));

select * from Picture;

请有人帮我解决这个问题。我正在使用 MySQL。您也可以给我 MySQL 和 SQL Developer 的解决方案。

最佳答案

The Fine Manual解释:

The FILE privilege gives you permission to read and write files on the server host using ... the LOAD_FILE() function. A user who has the FILE privilege can read any file on the server host that is either world-readable or readable by the MySQL server.

您没有与我们分享任何 SHOW GRANT 输出。

考虑发出 GRANT FILE ON *.* TO 'X'@'Y' 命令。

此外,如果您的连接字符串指的是 localhost 以外的机器,您将需要验证 .gif 文件在该服务器机器上是可读的,而不是在您的客户端机器上。运行 mysqld 的 uid 是需要文件系统读取权限的 uid。

关于mysql - 如何在MySQL中插入图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47739630/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com