Check and Repair All MySQL Databases on Ubuntu

MySQL Optimize and Repair

The following command can be used to check and repair all MySQL databases on a Ubuntu or Debian Linux System. I've tested the commands on Ubuntu 20.04 and Debian 10. Repair MySQL databases on Ubuntu Linux sudo mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases MySQL database repair on Debian mysqlcheck --defaults-file=/etc/mysql/debian.cnf --auto-repair --optimize --all-databases The benefit of ... Read more

Manage the Postfix mail queue with postsuper, postqueue and mailq commands

Manage Postfix Mail Queue

Postfix provides several shell programs to manage the mail queue. These are: postsuper postqueue mailq In this tutorial, I will show you how to use these commands to manage the Postfix mail queue. Here are examples for common tasks: List all messages that are in the mail queue postqueue -p The output looks like this: ... Read more

How to change the Hostname on CentOS 8

The easiest way to change the hostname on CentOS 8 is to use the hostnamectl command. First I will check the current hostname by running "hostnamectl status" on the shell of my server: hostnamectl status The output on my system is: [[email protected] ~]# hostnamectl status Static hostname: server1.example.com Icon name: computer-vm Chassis: vm Machine ID: ... Read more

Optimize MySQL Performance with Mysqltuner

MySQL Optimization

This short tutorial describes the steps to optimize the performance of a MySQL database with the mysqltuner script. This tool can be used for MySQL and MariaDB. Install mysqltuner The mysqltuner High-Performance MySQL Tuning Script is available as a package on Debian 10 and Ubuntu 20.04, install it with at: sudo apt install mysqltuner For ... Read more

How to block access to a server by IP address on Linux

Block access using route command

Sometimes you might want to block connects to your server by IP address. E.g. when someone tries to attack your system. This can be done in several different ways, e.g. with iptables (firewall) rules or by setting up a reject route. Reject access with Linux route command Using iptables sometimes causes conflicts with installed firewalls ... Read more