Vollständige Anleitung zur Installation eines MySQL-Datenbankservers auf Ubuntu 22.04 mit produktionsreifer Konfiguration.
Einrichtung eines MySQL Datenbankservers auf Ubuntu 22.04 mit optimaler Konfiguration für die Produktion.
sudo apt update
sudo apt install mysql-server -y
sudo mysql_secure_installation
Konfigurieren Sie MySQL durch Bearbeiten von /etc/mysql/mysql.conf.d/mysqld.cnf:
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;
Passen Sie innodb_buffer_pool_size auf 70-80% des verfügbaren RAM für optimale Leistung an. Abfrage-Cache für leselastige Workloads aktivieren.
Verwenden Sie mysqldump für logische Backups oder Percona XtraBackup für heiße Backups ohne Ausfallzeiten.