The previous article explained the mysqltuner script to provide recommendations to increase MariaDB performance. This article will explain the primary-tuning script, which is an alternative or may also be an addition to providing recommendations for MariaDB.
Problem
How to install and run tuning-primer?
Solution
The primary-tuning script was created by Matthew Montgomery using a bash script to provide recommendations against a MySQL/MariaDB database. This script takes information from “SHOW STATUS LIKE…” and “SHOW VARIABLES LIKE…” to produce recommendations for tuning server variables. To download this script, use the command below:
git clone https://github.com/mattiabasone/tuning-primer.git
Go to the primary-tuning folder and permit so that the script can be run:
chmod +x tuning-primary.sh
Then, run the command below to run the primary-tuning script:
./tuning-primer.sh
There will be a display like the image below:

Press Enter, then you have to enter your username and password so that this script can access your MariaDB database, as in the image below:

After that, the script will display recommendations as in the image below:

Note
Because this script was created in 2018 and there has been no update, there are several errors that occur where on lines 1482 and 1483 (see first image) in the netstat command where at this time (November 2025), the netstat command has been changed to ss and also the password is written as plain text which is very dangerous if known by the unauthorized user.

