0

I made a backup of a Drupal9 site's database and tried to use it on another server.

I got the error:

#2006 - MySQL server has gone away

I thought that it was because of some file, query, or packet size limit, but no matter how much I compressed the database and how much I edited the server's parameters (such as "max_allowed_packet", etc).

Eventually I found out that it was none of that, but instead this part specifically:

ALTER TABLE `aza_node_revision__body`
ADD PRIMARY KEY (`entity_id`,`revision_id`,`deleted`,`delta`,`langcode`),
ADD KEY `bundle` (`bundle`),
ADD KEY `revision_id` (`revision_id`),
ADD KEY `body_format` (`body_format`);

Not knowing why this part failed, I tried dividing it into two:

ALTER TABLE `aza_node_revision__body`
ADD PRIMARY KEY (`entity_id`,`revision_id`,`deleted`,`delta`,`langcode`);

ALTER TABLE `aza_node_revision__body`
ADD KEY `bundle` (`bundle`),
ADD KEY `revision_id` (`revision_id`),
ADD KEY `body_format` (`body_format`);

Luckily, that worked, but I don't know why the server would disconnect when running this part of the query.

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • Can you reach the MySQL error log? Possibly there is something information there. – LSerni Nov 25 '21 at 21:59
  • Have you checked `wait_timeout ` variable? https://dev.mysql.com/doc/refman/8.0/en/gone-away.html – Ergest Basha Nov 25 '21 at 21:59
  • This might help: https://stackoverflow.com/questions/7942154/mysql-error-2006-mysql-server-has-gone-away – Ergest Basha Nov 25 '21 at 22:01
  • Ergest Basha, it wasn't the timeout nor the size, because I tested that little part of the query by itself and it threw the error right away. – julianx2rl Nov 26 '21 at 14:28
  • LSerni, it shows this: [ERROR] [MY-013183] [InnoDB] Assertion failure: ddl0buffer.cc:204:ptr < bounds.second thread 140711357826816 InnoDB: We intentionally generate a memory trap. InnoDB: Submit a detailed bug report to http://bugs.mysql.com. InnoDB: If you get repeated assertion failures or crashes, even InnoDB: immediately after the mysqld startup, there may be InnoDB: corruption in the InnoDB tablespace. Please refer to InnoDB: http://dev.mysql.com/doc/refman/8.0/en/forcing-innodb-recovery.html InnoDB: about forcing recovery. 16:52:28 UTC - mysqld got signal 6 ; – julianx2rl Nov 26 '21 at 14:36

0 Answers0