Usually net_write_timeout. If your application cannot read data at the server's write speed, the server will close the socket. net_write_timeout is the time limit, in seconds, for the server to attempt to send a result set. You can increase this limit, which is a session variable. This also appears in MariaDB JDBC's FAQ.