dienste:bytecluster0002:mariadb

Dies ist eine alte Version des Dokuments!


Container 'mariadb'

  • 1 GB RAM
  • 2 Cores
  • 8 GB HDD (root-fs)
  • interne IPs
    • 10.2.0.100, fd00:10:2:0::100
    • 10.3.0.100, fd00:10:3:0::100 (MariaDB)
  • MariaDB 10

Datenbanken

  • nextcloud
    • user: nc_user
  1. Zur Datenbank verbinden
    • sudo mysql
  2. Datenbank anlegen und Benutzer mit Passwort zuweisen

    MySQL-Konsole "MariaDB [(none)]"

    CREATE DATABASE 'databasename';
    GRANT ALL PRIVILEGES ON 'databasename'.* TO 'username'@'%' IDENTIFIED BY 'password';
    FLUSH PRIVILEGES;
  1. Zur Datenbank verbinden
    • sudo mysql
  2. Benutzer neues Passwort zuweisen

    MySQL-Konsole "MariaDB [(none)]"

    ALTER USER 'username'@'%' IDENTIFIED BY 'password';
    FLUSH PRIVILEGES;
  • Standard-Template mit Benutzern
  1. MariaDB-Server installieren
    • apt-get install mariadb-server
  2. MariaDB - Erstkonfiguration
    • mysql_secure_installation
      • Set root password? [Y/n]: Y
      • New password: PASSWORT
      • Re-enter new password: PASSWORT
      • Remove anonymous users? [Y/n]: Y
      • Disallow root login remotely? [Y/n]: Y
      • Remove test database and access to it? [Y/n]: Y
      • Reload privilege tables now? [Y/n]: Y
  3. Benutzerdefinierte Konfiguration anlegen

    /etc/mysql/mariadb.conf.d/99-bytecluster.cnf

    [mysqld]
    # An lokale IP binden
    bind-address                    = 10.3.0.100
    
    # Binlog deaktivieren
    skip-log-bin
    
    # InnoDB verwenden
    default_storage_engine          = InnoDB
    
    # InnoDB-Optimierungen
    innodb_buffer_pool_size         = 256M
    innodb_log_buffer_size          = 8M
    innodb_log_file_size            = 128M
    
    innodb_log_files_in_group       = 2
    innodb_flush_log_at_trx_commit  = 2
    innodb_flush_method             = O_DIRECT
    innodb_file_per_table           = 1 
  4. MariaDB neustarten
    • systemctl restart mariadb.service
  • dienste/bytecluster0002/mariadb.1601817068.txt.gz
  • Zuletzt geändert: 04.10.2020 15:11
  • von chaos