Skip to content

Instantly share code, notes, and snippets.

@gh640
Last active February 28, 2024 02:10
Show Gist options
  • Save gh640/41d6b0da42c2850144f3e95f8223871b to your computer and use it in GitHub Desktop.
Save gh640/41d6b0da42c2850144f3e95f8223871b to your computer and use it in GitHub Desktop.
Sample: Use MySQLTuner in `mariadb` Docker container
# 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