doubeizhong5178 2013-04-26 08:07
浏览 47
已采纳

如何使用php从mysql列中提取超过1mb的数据

I have 3Mb string data in mysql column. When I run a SQL query at mysql prompt it returns complete data. But from php I am unable to fetch complete data, it is returning only 1mb of data data.

my mysql configs have max_allowed_packet_size=33554432

PHP max_post_size=30mb and memory_limit=300mb

  • 写回答

1条回答 默认 最新

  • dongxia5394 2013-04-26 11:02
    关注

    Are you using PDO?
    The problem may be that the insert buffer default value is 1MiB.

    To change it, update the line used to connect to the database by adding the new value for the parameter MYSQL_ATTR_MAX_BUFFER_SIZE:

    $pdo = new PDO("your connection_settings", "user", "pass", array(PDO::MYSQL_ATTR_MAX_BUFFER_SIZE=>1024*1024*5));
    

    In this example, the new size of the buffer will be 5MiB.

    See this page for more information about this attribute.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?