Last active
July 2, 2019 22:51
-
-
Save crafter999/e21803a09b8bf7d5d0f88ad7f249e61a to your computer and use it in GitHub Desktop.
Disable mysql timeout after 8 hours (mysql)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Needed variables: host and username | |
| if [ -z "$1" ] || [ -z "$2" ] ; then | |
| echo "Usage: ./mysql-noTimeout.sh 127.0.0.1 myDatabaseUsername" | |
| else | |
| mysql -h "$1" -u "$2" -e ' | |
| SET wait_timeout=31536000; | |
| SET interactive_timeout=31536000; | |
| SET GLOBAL wait_timeout=31536000; | |
| SET GLOBAL interactive_timeout=31536000; | |
| show variables like "%timeout%"; | |
| ' -p | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment