User Tools

Site Tools


servers:mariadb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
servers:mariadb [2021/06/18 17:17] Sean Rhoneservers:mariadb [2024/08/13 16:34] (current) – removed Sean Rhone
Line 1: Line 1:
-====== Information ====== 
- 
-  * MariaDB ((https://mariadb.org/about)) 
-  * [[Information:Realm of Espionage]] 
- 
-===== Prerequisites ===== 
- 
-  * [[distros:opensuse_tumbleweed_server|openSUSE Tumbleweed]] 
- 
-====== Settings ====== 
- 
-  * Settings being done before installation is intentional 
- 
-  sudo mkdir -p '/etc/my.cnf.d' && sudo -e '/etc/my.cnf.d/custom.cnf' 
- 
-<code> 
-[client] 
-default-character-set = utf8mb4 
- 
-[mysql] 
-default-character-set = utf8mb4 
- 
-[mysqld] 
-character-set-client-handshake = FALSE 
-character-set-server = utf8mb4 
-collation-server = utf8mb4_unicode_ci 
-init-connect='SET NAMES utf8mb4' 
-expire_logs_days = 7 
-max_binlog_size = 100M 
-skip-networking = On 
-table_definition_cache = 1400</code> 
- 
-==== Verify ===== 
- 
-**** 
- 
-  sudo mysqladmin variables | egrep 'utf8|networking|socket' 
- 
-====== Dependencies ====== 
- 
-**** 
- 
-  sudo zypper install 'mariadb' 
- 
-====== Initial Setup ====== 
- 
-**** 
- 
-  sudo systemctl enable 'mariadb' --now && sudo mysql_secure_installation 
- 
-====== Database Repair and Optimization ====== 
- 
-===== Create MySQL User ===== 
- 
-  sudo mysql 
- 
-  GRANT SELECT, INSERT ON *.* to 'maintenance'@'localhost' IDENTIFIED BY 'x'; 
- 
-  FLUSH PRIVILEGES; 
- 
-  EXIT 
- 
-===== Authentication File ===== 
- 
-  sudo mkdir -p '/var/lib/mysql/auth' && sudo chown -R 'mysql':'mysql' '/var/lib/mysql/auth' && sudo -u 'mysql' -e '/var/lib/mysql/auth/maintenance' && sudo chmod '600' '/var/lib/mysql/auth/maintenance' 
- 
-<code> 
-[mysqlcheck] 
-user=maintenance 
-password=x</code> 
- 
-===== Service ===== 
- 
-  sudo -e '/etc/systemd/system/db-m.service' 
- 
-<code> 
-[Service] 
-User=mysql 
-Group=mysql 
-Type=oneshot 
-ExecStart='/usr/bin/mysqlcheck' --defaults-extra-file='/var/lib/mysql/auth/maintenance' --auto-repair --optimize --all-databases --force 
-ExecStartPost='/usr/bin/sync'</code> 
- 
-===== Timer ===== 
- 
-  sudo -e '/etc/systemd/system/db-m.timer' && sudo systemctl daemon-reload && sudo systemctl enable 'db-m.timer' --now && sudo systemctl start 'db-m' && sudo systemctl status 'db-m' -l 
- 
-<code> 
-[Unit] 
-Description=MariaDB Database Check, Repair, and Optimization 
-After=mariadb.service 
- 
-[Timer] 
-OnCalendar=weekly 
-Persistent=true 
- 
-[Install] 
-WantedBy=timers.target</code> 
- 
-====== Notable Commands ====== 
- 
-===== Show Users on Server ===== 
- 
-**** 
- 
-  select User,Host from mysql.user; 
- 
-===== Socket File ===== 
- 
-**** 
- 
-  /var/lib/mysql/mysql.sock 
  
/srv/www/wiki/data/attic/servers/mariadb.1624051064.txt.gz · Last modified: by Sean Rhone