Skip to content

Instantly share code, notes, and snippets.

@danigunawan
Created August 2, 2022 15:52
Show Gist options
  • Save danigunawan/e710062a1a4f233a5ca636d576c3461e to your computer and use it in GitHub Desktop.
Save danigunawan/e710062a1a4f233a5ca636d576c3461e to your computer and use it in GitHub Desktop.
MySQL Tunner On Docker
# 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