Állítsuk le a MariaDB kiszolgálót:
systemctl stop mysql
A biztonság kedvéért mentsük el a régi my.cnf fájlt:
mv /etc/mysql/my.cnf /etc/mysql/my.cnf.old
Az új my.cnf fájl tartalma legyen ez:
[mysqld_multi] mysqld = /usr/bin/mysqld_safe mysqladmin = /usr/bin/mysqladmin user = multi_admin password = Pa$$w0rd !includedir /etc/mysql/conf.d/
A fájlban található felhasználóra az adatbázis-kiszolgálók leállításához lesz szükségünk. A /etc/mysql/conf.d/mariadb.cnf fájl tartalma legyen az alábbi:
[client] default-character-set = utf8 [mysqld] character-set-server = utf8 collation-server = utf8_general_ci character_set_server = utf8 collation_server = utf8_general_ci
A /etc/mysql/conf.d/my3306.cnf fájl tartalma:
[mysqld3306] user = mysql pid-file = /var/run/mysqld/mysqld.pid socket = /var/run/mysqld/mysqld.sock port = 3306 basedir = /usr datadir = /srv/db/mysql tmpdir = /tmp lc_messages_dir = /usr/share/mysql lc_messages = en_US skip-external-locking bind-address = 127.0.0.1 max_connections = 16 connect_timeout = 5 wait_timeout = 600 max_allowed_packet = 100M thread_cache_size = 128 sort_buffer_size = 4M bulk_insert_buffer_size = 16M tmp_table_size = 32M max_heap_table_size = 32M myisam_recover = BACKUP key_buffer_size = 16M table_open_cache = 400 myisam_sort_buffer_size = 16M concurrent_insert = 2 read_buffer_size = 2M read_rnd_buffer_size = 1M query_cache_limit = 128K query_cache_size = 64M query_cache_type = DEMAND log_warnings = 2 slow_query_log_file = /var/log/mysql/mariadb-slow.log long_query_time = 10 log_slow_verbosity = query_plan log_bin = /var/log/mysql/mariadb-bin log_bin_index = /var/log/mysql/mariadb-bin.index binlog_format = mixed expire_logs_days = 10 max_binlog_size = 100M default_storage_engine = InnoDB innodb_buffer_pool_size = 256M innodb_log_buffer_size = 8M innodb_file_per_table = 1 innodb_open_files = 400 innodb_io_capacity = 400 innodb_flush_method = O_DIRECT
A /etc/mysql/conf.d/my3307.cnf fájl tartalma az alábbi:
[mysqld3307] user = mysql pid-file = /var/run/mysqld3307/mysqld3307.pid socket = /var/run/mysqld3307/mysqld3307.sock port = 3307 basedir = /usr datadir = /srv/db/mysql3307 tmpdir = /tmp lc_messages_dir = /usr/share/mysql lc_messages = en_US skip-external-locking bind-address = 127.0.0.1 max_connections = 16 connect_timeout = 5 wait_timeout = 600 max_allowed_packet = 100M thread_cache_size = 128 sort_buffer_size = 4M bulk_insert_buffer_size = 16M tmp_table_size = 32M max_heap_table_size = 32M myisam_recover = BACKUP key_buffer_size = 16M table_open_cache = 400 myisam_sort_buffer_size = 16M concurrent_insert = 2 read_buffer_size = 2M read_rnd_buffer_size = 1M query_cache_limit = 128K query_cache_size = 64M query_cache_type = DEMAND log_warnings = 2 slow_query_log_file = /var/log/mysql3307/mariadb3307-slow.log long_query_time = 10 log_slow_verbosity = query_plan log_bin = /var/log/mysql3307/mariadb3307-bin log_bin_index = /var/log/mysql3307/mariadb3307-bin.index binlog_format = mixed expire_logs_days = 10 max_binlog_size = 100M default_storage_engine = InnoDB innodb_buffer_pool_size = 256M innodb_log_buffer_size = 8M innodb_file_per_table = 1 innodb_open_files = 400 innodb_io_capacity = 400 innodb_flush_method = O_DIRECT
A my3308.cnf és a my3309.cnf fájlt hasonlóképpen készítsük el, figyelve a portszámok pontos átvezetésére. A fenti paraméterek természetesen csak a tesztrendszer kedvéért kerültek meghatározásra.