send of 8192 bytes failed with errno=32 Broken pipe

mysqli::query(): send of 8192 bytes failed with errno=32 Broken pipe
mysqli::query(): send of 72 bytes failed with errno=32 Broken pipe

問題
我的 mysql 匯入數據時遇到以上問題
我是上傳了一個 10M 的圖片到一個編輯器中,編輯器產生的網址是 data:base64
然後它就不給匯入到數據庫了
請問這是什麼問題?

環境
Server type: MariaDB
Server version: 10.1.25-MariaDB-1~xenial - mariadb.org binary distribution
Apache/2.4.18 (Ubuntu)
Database client version: libmysql - mysqlnd 5.0.12-dev - 20150407 - $Id: b5c5906d452ec590732a93b051f3827e02749b83 $
PHP extension: mysqli Documentation
PHP version: 7.0.31-1+ubuntu16.04.1+deb.sury.org+1
Version information: 4.5.4.1deb2ubuntu2.1

阅读 7.4k
3 个回答

超出字段长度了吧? 10M相当于10485760字节,Varchar类型的字段应该无法承担这个任务。
其实你一直在错误的方向上挣扎,正确的方式是:将图片上传的图片服务器,编辑器中只保存图片路径,而不是现在的Base64。 你再找找其他开源Editor,需要在拖拽图片后,自动完成上传动作(配置上传路径),然后将图片路径填写到编辑器中。

Froala Editor 在编辑器里上传图片到自己的服务端

如果有人正在為這個問題而掙扎, 下面是修復程式:

嘗試在您的 mysql 中更改/設置 wait_timeout my.cnf 設定檔:

wait_timeout=3600

此設定檔位於/etc/mysql/my.cnf (Ubuntu/Debian) 和`usr/local/mysql/my.cnf (OSX)。

重新開機 mysql 伺服器, 它應該工作。

这么大的图片,为何不上传到文件服务器?

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题