dongshao1156 2015-03-20 14:51
浏览 621

PDO :: __ construct():发送108个字节失败,errno = 32 Broken pipe

When I log into my command line mysql I can no longer access any PHP application that requires a database connection. This happens every time. The steps to cause the issue on my localhost:

Command line:
mysql -u root (no password for localhost)
mysql> 

I do not execute or do anything at this point. I load up any page that requires a database connection using root:

PDO::__construct(): send of 108 bytes failed with errno=32 Broken pipe

If I exit mysql the pages come back but another issue comes up when attempting to load two pages at the same time (in browser tabs) it will cause one of them to break until the page loads, then I can refresh

My.cnf:

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

wait_timeout=5000
max_allowed_packet=100m
max_user_connections=1000
  • 写回答

1条回答 默认 最新

  • dongzhabo2796 2017-12-13 06:32
    关注

    Set up wait_timeout in your MySQL my.cnf config file:

    wait_timeout=3600

    This config file is located in the /etc/mysql/my.cnf (Ubuntu/Debian) and /usr/local/mysql/my.cnf (OSX) and /location of server bin folder/mysql/my.cnf for windows.

    Restart MySQL server and check this should work.

    评论

报告相同问题?