Created
October 20, 2010 07:46
-
-
Save josue/635982 to your computer and use it in GitHub Desktop.
MySQL clear query cache via commandline
This file contains 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 | |
# Created by: Josue Rodriguez <[email protected]> (c) 2010. | |
# Clear MySQL Cache | |
# Download file into directory "/usr/bin" then run "sudo chmod +x /usr/bin/mysqlclearcache" | |
mysql_options=$1 | |
if [ "$mysql_options" == "--help" ]; then | |
echo -e "\nUsage: mysqlclearcache [OPTIONS]\n" | |
echo -e "- options are same as when you use the regular 'mysql' command." | |
echo -e "- example: mysqlclearcache -uroot -p ....\n" | |
else | |
mysql $mysql_options -e "RESET QUERY CACHE" && echo -e "\nMySQL Cache Query Cleared\n" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment