resty mysql 插入大文件(20m以上)报错

53 views
Skip to first unread message

shelton zhu

unread,
Aug 24, 2021, 8:46:00 AM8/24/21
to openresty
openresty版本:  1.19.9.1

mysql版本:Ver 8.0.24 for Linux on x86_64 (MySQL Community Server - GPL)

连接代码:

local res, err, errno, sqlstate =
db:connect(
{
host = addr,
port = port,
database = database,
user = user,
password = password,
charset = 'utf8',
max_packet_size = 100 * 1024 * 1024 -- 默认1M 改为 100M
}
)

错误信息:

failed to send query: broken pipe

问题描述:

使用resty.mysql 上传文件2进制保存到mysql数据库时,文件超过22m时候失败,报错如上,请问这是什么问题。

李俊龙

unread,
Sep 4, 2021, 8:58:54 PM9/4/21
to openresty
可以看看openresty的错误日志和mysql的错误日志
Reply all
Reply to author
Forward
0 new messages