[Database] MySQL Tunning

For tuning MySQL, normally it will check index scan, cache and any hardware allocation align with database or not. To measure it, there are several tools to support your judgement.

phpMyAdmin

It is the web based MySQL management console, also it embed performance advisor. For quick start in local computer, you can run phpMyAdmin in docker with command as below.

docker run -d -e PMA_HOST=<<External host name>> -p 8080:80 phpmyadmin

To get performance advisor, go to Status > Advisor, it will generate report and recommendation.

MySQLTunner

To overall scan MySQL and check any area to optimize and vulnerables found, MySQLTunner is a great tools to do so. To do so, run command in Linux as below:

# Install Perl to execute perl script.
sudo yum install perl -y

# Create folder and store MySQL Tuner files.
mkdir mySqlTunner
cd mySqlTunner/
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

# Execute script and store report in text file.
perl mysqltuner.pl --host <<Database host name>> --user <<User name>> --pass <<Password>> --forcemem 1024 > result.txt

About C.H. Ling 262 Articles
a .net / Java developer from Hong Kong and currently located in United Kingdom. Thanks for Google because it solve many technical problems so I build this blog as return. Besides coding and trying advance technology, hiking and traveling is other favorite to me, so I will write down something what I see and what I feel during it. Happy reading!!!

Be the first to comment

Leave a Reply

Your email address will not be published.


*


This site uses Akismet to reduce spam. Learn how your comment data is processed.