I have a MariaDB 10.1.21 database running in Fedora 25. I successfully ran alter table statements on auto_incrementcolumns in the past. After updating MariaDB to 10.1.21, but without changing any settings, I now get this with any alter table, even as root:

ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 2

I temporarily increased every timeout variable, even the ones that shouldn't matter.

MariaDB [valar]> show variables like '%timeout%';
| Variable_name               | Value    |
| connect_timeout             | 8000     |
| deadlock_timeout_long       | 50000000 |
| deadlock_timeout_short      | 10000    |
| delayed_insert_timeout      | 300      |
| innodb_flush_log_at_timeout | 1        |
| innodb_lock_wait_timeout    | 50       |
| innodb_rollback_on_timeout  | OFF      |
| interactive_timeout         | 31536000 |
| lock_wait_timeout           | 31536000 |
| net_read_timeout            | 30       |
| net_write_timeout           | 60       |
| slave_net_timeout           | 3600     |
| thread_pool_idle_timeout    | 60       |
| wait_timeout                | 31536000 |

What's going on?

1 Answer 1


Which version of MariaDB are you upgrading from? It could be that there has been a table or index format change between the versions. Or it could be that the newer version is using the ONLINE alter table and the previous version was not, resulting in the newer version using more of a particular resource. What's the server doing during the time before the timeout? (swapping, writing to disk, etc)

You can try executing the command with the '--old-alter-table' argument.

If you still don't have any luck, the first thing I would try is to rebuild the table. Dump it (good to have a backup in this situation anyway) into an sql file and then reload it into a table with a new, different name. If all goes well drop the old one and rename the new one. Now try the alter statement again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.