User Tools

Site Tools


servers:linux: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:linux:mariadb [2024/10/19 00:16] – [Authentication File] Sean Rhoneservers:linux:mariadb [2025/08/27 20:00] (current) Sean Rhone
Line 3: Line 3:
   * MariaDB ((https://mariadb.org/about))   * MariaDB ((https://mariadb.org/about))
   * [[Information:Realm of Espionage]]   * [[Information:Realm of Espionage]]
- 
-===== References ===== 
- 
-  * https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ 
-  * https://mariadb.com/kb/en/legacy-clients-and-utilities/ 
  
 ===== Prerequisites ===== ===== Prerequisites =====
  
-  * [[linux;distros;server;fedora_server|Fedora Server]] +  * [[linux:distros:server:opensuse_tumbleweed_server|openSUSE Tumbleweed (Server)]]
-  * [[linux;distros;fedora_workstation_gnome|Fedora Workstation (GNOME)]] ((for ''localhost'' game servers))+
  
 ====== Settings ====== ====== Settings ======
Line 35: Line 29:
 max_binlog_size = '100M' max_binlog_size = '100M'
 skip-networking = 'On' skip-networking = 'On'
-table_definition_cache = '1400'</code>+table_definition_cache = '1400' 
 + 
 +# End</code>
  
 ==== Verify ===== ==== Verify =====
Line 47: Line 43:
 **** ****
  
-  sudo dnf install 'mariadb-server'+  sudo zypper install 'mariadb'
  
 ====== Initial Setup ====== ====== Initial Setup ======
Line 63: Line 59:
   sudo mariadb-check --optimize --all-databases --force --extended --auto-repair   sudo mariadb-check --optimize --all-databases --force --extended --auto-repair
  
-===== Create MySQL User =====+===== Service ===== 
 + 
 +==== Create MySQL User ====
  
   sudo mariadb   sudo mariadb
Line 75: Line 73:
   EXIT   EXIT
  
-===== Authentication File =====+==== Authentication File ====
  
-  sudo mkdir -p '/var/lib/mysql/auth' && sudo -e '/var/lib/mysql/auth/maintenance' && sudo chown -v -R 'mysql':'mysql' '/var/lib/mysql/auth' && sudo chmod -v '600' '/var/lib/mysql/auth/maintenance' && sync+  sudo mkdir -p '/var/lib/mysql/auth' && sudo -e '/var/lib/mysql/auth/maintenance' && sudo chown -v -R 'mysql':'mysql' '/var/lib/mysql/auth' && sudo chmod -v '600' '/var/lib/mysql/auth/maintenance'
  
 <code> <code>
 [mariadb-check] [mariadb-check]
 user=maintenance user=maintenance
-password=x</code>+password=x
  
-===== Service =====+# End</code> 
 + 
 +==== Service ====
  
   sudo -e '/etc/systemd/system/db-m.service'   sudo -e '/etc/systemd/system/db-m.service'
Line 94: Line 94:
 Type=oneshot Type=oneshot
 ExecStart='/usr/bin/mariadb-check' --defaults-extra-file='/var/lib/mysql/auth/maintenance' --optimize --all-databases --force --extended --auto-repair ExecStart='/usr/bin/mariadb-check' --defaults-extra-file='/var/lib/mysql/auth/maintenance' --optimize --all-databases --force --extended --auto-repair
-ExecStartPost='/usr/bin/sync'</code>+ExecStartPost='/usr/bin/sync'
  
-===== Timer =====+# End</code> 
 + 
 +==== Timer ==== 
 + 
 +  * Weekly
  
   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   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
Line 110: Line 114:
  
 [Install] [Install]
-WantedBy=timers.target</code>+WantedBy=timers.target 
 + 
 +# End</code>
  
 ====== Notable Commands ====== ====== Notable Commands ======
Line 124: Line 130:
 **** ****
  
-  /var/lib/mysql/mysql.sock+  /run/mysql/mysql.sock 
 + 
 +===== No sudo auth file ===== 
 + 
 +  * Uses an ''auth'' file; can use ''mariadb'' with user/pass flags instead of ''sudo'' 
 + 
 +  sudo mariadb-dump --defaults-extra-file='/var/lib/mysql/auth/piwigo' --single-transaction 'piwigo' -r ~/'piwigo-database-manual-'$(date +%Y-%m-%d)'.sql'
  
/usr/local/www/wiki/data/attic/servers/linux/mariadb.1729311367.txt.gz · Last modified: by Sean Rhone