Robert Kusznier
Robert Kusznier

Reputation: 6931

MariaDB command line stops being responsive after some time

I'm running MariaDB's (version: Ver 15.1 Distrib 10.3.12-MariaDB) mysql command to interact with the database. I'm using that multiple times a day, so I just leave window running that console open and come back to it whenever I need it.

The problem is that after some time of my inactivity (let's say 1 hour), when I come back to the console window it's totally unresponsive. I enter commands and don't get any feedback, not even an error - the console is simply dead.

I assume it's some timeout that kills the connection after some time of inactivity.

How can I fix that?

Upvotes: 0

Views: 303

Answers (1)

Raymond Nijland
Raymond Nijland

Reputation: 11602

Is there a way to disable that behavior (timeout)?

Disabling is most likely a bad idea, if applications does not close the connection, the connection keeps active.
It might even disallow connections from normal MySQL users when the max_connections limit is reached, I believe MySQL users with SUPER privilege are still able to connect then.

You can use

SET SESSION wait_timeout = 28800 

for your SQL IDE's connections

For shell/console mysql application

mysql [options] --wait-timeout=28800 

Which sets wait-timeout at MySQL's default config off 8 hours see manual

Upvotes: 1

Related Questions