Last active
February 20, 2025 09:31
-
-
Save gh640/41d6b0da42c2850144f3e95f8223871b to your computer and use it in GitHub Desktop.
Sample: Use MySQLTuner in `mariadb` Docker container
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
# MySQLTuner: https://github.com/major/MySQLTuner-perl | |
# Open Bash with the container. | |
docker exec [mariadb_or_mysql] bash | |
# Change the working directory to `/tmp`. | |
cd /tmp | |
# Install wget. | |
apt-get update | |
apt-get install -y wget | |
# Download mysqltuner. | |
wget http://mysqltuner.pl/ -O mysqltuner.pl | |
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/basic_passwords.txt -O basic_passwords.txt | |
wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/vulnerabilities.csv -O vulnerabilities.csv | |
# Run MySQLTuner. | |
chmod u+x mysqltuner.pl | |
./mysqltuner.pl --user $MYSQL_USER --pass $MYSQL_PASSWORD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment