Complete handleiding voor het installeren van een MySQL-databaseserver op Ubuntu 22.04 met een productieklare configuratie.
Stel MySQL databaseserver op op Ubuntu 22.04 met optimale configuratie voor productiegebruik.
sudo apt update
sudo apt install mysql-server -y
sudo mysql_secure_installation
MySQL instellen door /etc/mysql/mysql.conf.d/mysqld.cnf te bewerken:
max_connections = 200
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M
sudo mysql
CREATE DATABASE myapp;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON myapp.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;
Pas innodb_buffer_pool_size aan tot 70-80% van de beschikbare RAM voor optimale prestaties. Zoekcache inschakelen voor leeszware werkbelasting.
Gebruik mysqldump voor logische back-ups of Percona XtraBack-up voor hete back-ups zonder downtime.