When running a MySQL server, it’s important to tune your configuration to match your environment and use case. This can be a daunting task even for an expert server administrator. To make things simple, you’ll want to use a free tool called MySQLTuner. This will give you a great recommendation for starting your server’s custom configuration.
You’ll want to begin by logging in to your server via SSH and then using the ‘su’ command to change to a root user. Or, run each command with ‘sudo’ prefixed to the beginning. It’s also important that your MySQL server has been running for at least 24 hours to get an accurate recommendation.
First, download the script.
wget mysqltuner.pl
Change the permissions to be able to execute.
chmod +x mysqltuner.pl
Run the MySQLTuner Perl script.
./mysqltuner.pl
Implement the recommended changes in your MySQL configuration file using your favorite text editor (I use Pico, but many systems default with Nano).
pico /etc/my.cnf
After saving your changes, restart MySQL Server and monitor performance improvements. Revisit MySQL Tuner regularly for further recommendations.
systemctl restart mysql
Using this method to configure your MySQL server can have an immediate effect on overall reliability, efficiency, and performance. If you don’t feel comfortable running this script on your own and you’re a Florida Web Architects customer, please reach out to us so that we can support you in your configuration. Interested in moving to a server on our hosting platform? Click here!