Ρύθμιση παραμέτρων διακομιστή

Εγκατάσταση και ρύθμιση παραμέτρων MySQL στο Ubuntu 22.04

Πλήρης οδηγός για την εγκατάσταση του διακομιστή βάσης δεδομένων MySQL στο Ubuntu 22.04 με διαμόρφωση έτοιμη για παραγωγή.

December 20, 2025 6182 προβολές

Installing and Configuring MySQL on Ubuntu 22.04

Set up MySQL database server on Ubuntu 22.04 with optimal configuration for production use.

Installation

sudo apt update
sudo apt install mysql-server -y
sudo mysql_secure_installation

Initial Configuration

Configure MySQL by editing /etc/mysql/mysql.conf.d/mysqld.cnf:

max_connections = 200
innodb_buffer_pool_size = 1G
innodb_log_file_size = 256M

Create Database and User

sudo mysql
CREATE DATABASE myapp;
CREATE USER 'myuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON myapp.* TO 'myuser'@'localhost';
FLUSH PRIVILEGES;

Performance Tuning

Adjust innodb_buffer_pool_size to 70-80% of available RAM for optimal performance. Enable query cache for read-heavy workloads.

Backup Strategy

Use mysqldump for logical backups or Percona XtraBackup for hot backups without downtime.

Security Recommendations

  • Change default port from 3306 to a custom port
  • Enable SSL/TLS connections
  • Configure firewall to allow only specific IPs
  • Regular security updates

Βαθμολογήστε αυτό το άρθρο

-
Loading...

Αναζήτηση Εγγράφων
Ρύθμιση παραμέτρων διακομιστή

Δείτε όλα τα άρθρα