mysqldump: Got errno 32 on write: 'all of a sudden' plenty of room still…Drupal 6 installation

前端 未结 1 843
闹比i
闹比i 2021-02-20 03:03

On the dev server, I tried to run the same script I\'ve been using for almost a year and at the end got the : mysqldump: Got errno 32 on write

Last week, the IT sysadmin

1条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-20 03:11

    Seems strange

    [root@*****]# perror 28
    OS error code  28:  No space left on device
    [root@*****]# perror 32
    OS error code  32:  Broken pipe
    

    Since the mysqldump keeps breaking at random places, it is space-related, and no disk full condition, I would suspect the problem at a deeper layer : the MySQL Packet. What is a MySQL Packet?

    According to the page 99 of the Book

    BookImage

    here are paragraphs 1-3 explaining it:

    MySQL network communication code was written under the assumption that queries are always reasonably short, and therefore can be sent to and processed by the server in one chunk, which is called a packet in MySQL terminology. The server allocates the memory for a temporary buffer to store the packet, and it requests enough to fit it entirely. This architecture requires a precaution to avoid having the server run out of memory---a cap on the size of the packet, which this option accomplishes.

    The code of interest in relation to this option is found in sql/net_serv.cc. Take a look at my_net_read(), then follow the call to my_real_read() and pay particular attention to net_realloc().

    This variable also limits the length of a result of many string functons. See sql/field.cc and sql/intem_strfunc.cc for details.

    Given this explanation, making bulk INSERTs will load/unload a MySQL Packet rather quickly. This is especially true when max_allowed_packet is too small for the given load of data coming at it.

    I wrote about this before : MySQL server has gone away obstructing import of large dumps

    Try raising max_allowed_packet for the mysqldump to 1G as follows:

    mysqldump --max-allowed-packet=1073741824 ...
    

    and try the mysqldump.

    If this does not do it, then do this:

    Added this to my.cnf

    [mysqld]
    max_allowed_packet = 1G
    

    Then, login to MySQL as root@localhost and run this

    mysql> SET GLOBAL max_allowed_packet = 1024 * 1024 * 1024;
    

    and try the mysqldump.

    Give it a Try !!!

    0 讨论(0)
提交回复
热议问题