This howto is tested on:
- Debian 10.0 Buster
Requirements
This howto requires:
- a MySQL or MariaDB server, as described by Install MariaDB (MySQL) on Debian.
- the MariaDB sys schema, as described by Install the MariaDB sys schema on Debian.
Environment setup
Detect if sudo is available (“command” is used if not):
cmdProxy='command'
command type -f 'sudo' &>'/dev/null' && cmdProxy='sudo'
Installation
Install the software:
${cmdProxy} apt install 'mysqltuner'
Performance schema
Enable the database server performance schema:
${cmdProxy} tee '/etc/mysql/conf.d/performance-schema.cnf' <<< "[mysqld]
performance_schema = on"
Reload the database server configuration:
${cmdProxy} systemctl 'restart' 'mariadb'
Usage
Wait at least 24h after starting the MariaDB (MySQL) server to use this tool. This allow for the accumulated usage data to be pertinent.
Run the software:
${cmdProxy} mysqltuner
The tool check the MariaDB (MySQL) server settings and provide tips on possible performance enhancements.
Thanks
- Thanks to MySQLTuner developers.
0 Comments