User Tools

Site Tools


servers:bsd: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:bsd:mariadb [2024/10/03 01:37] Sean Rhoneservers:bsd:mariadb [2026/03/05 23:57] (current) – [Script] Sean Rhone
Line 1: Line 1:
 +====== Information ======
 +
 +  * MariaDB ((https://mariadb.org/))
 +  * Server
 +  * [[information:realm_of_espionage|Realm of Espionage]]
 +
 +===== Prerequisites =====
 +
 +  * [[bsd:server:freebsd_16.0|FreeBSD 16.0]]
 +
 ====== Dependencies ====== ====== Dependencies ======
  
-  su -l+  su -
  
-  pkg install 'mariadb114-server'+  pkg install 'mariadb118-server'
  
 ====== Settings ====== ====== Settings ======
 +
 +  su -
  
   ee '/usr/local/etc/mysql/conf.d/custom.cnf'   ee '/usr/local/etc/mysql/conf.d/custom.cnf'
Line 23: Line 35:
 expire_logs_days = '7' expire_logs_days = '7'
 max_binlog_size = '100M' max_binlog_size = '100M'
-skip-networking = 'On+skip-networking = 'Off
-table_definition_cache = '1400'</code>+table_definition_cache = '1400' 
 + 
 +# End</code>
  
 ====== Service ====== ====== Service ======
  
-  su -l+===== Initial ===== 
 + 
 +  su -
  
   sysrc mysql_enable="YES"   sysrc mysql_enable="YES"
Line 34: Line 50:
   service 'mysql-server' start   service 'mysql-server' start
  
-  mariadb-secure-installation+===== Status ===== 
 + 
 +  su -
  
   service 'mysql-server' status   service 'mysql-server' status
  
-  /usr/local/etc/rc.d/mysql-server+====== Initial Setup ======
  
-  mysqladmin+  su -
  
-  mysqlcheck -u 'root' -p -o -A -f -e --auto-repair+  mariadb-secure-installation
  
-  mysqladmin -u 'root' -p variables | egrep 'utf8|networking|socket'+====== Database Repair and Optimization ======
  
-  /tmp/mysql.sock+===== One-shot =====
  
-  /tmp/mysqlx.sock+  su -
  
-====== Install Notes ======+  mariadb-check -o -A -f -e --auto-repair
  
-===== Install Notes =====+===== cron ===== 
 + 
 +==== Script ==== 
 + 
 +  mkdir -p ~/'.local/scripts/mariadb' && ee ~/'.local/scripts/mariadb/optimize.sh' && chmod +x ~/'.local/scripts/mariadb/optimize.sh'
  
 <code> <code>
-===== +#!/bin/sh
-Message from mariadb114-server-11.4.2:+
  
--- +cd '/tmp'
-MariaDB respects hier(7) and doesn't check /etc and /etc/mysql for +
-my.cnf. Please move existing my.cnf files from those paths to +
-/usr/local/etc/mysql or /usr/local/etc. Sample +
-configuration files are provided in /usr/local/etc/mysql +
-and /usr/local/etc/mysql/conf.d. +
-The rc(8) script no longer uses /var/db/mysql/my.cnf for configuration +
-nor /var/db/mysql for logs and PID-file.+
  
-This port does NOT include the mytop perl script, this is included in +'/usr/local/bin/mariadb-check' -o -A -f -e --auto-repair > '/dev/null'
-the MariaDB tarball but the most recent version can be found in the +
-databases/mytop port+
  
-Using wsrep clustering requires adding a configuration file. +'/bin/sync'
-Copy /usr/local/etc/mysql/conf.d/wsrep.conf.sample to +
-/usr/local/etc/mysql/conf.d/wsrep.conf and change what you need there. +
-</code>+
  
-===== Service =====+# End</code> 
 + 
 +  su 'root' -c ~/'.local/scripts/mariadb/optimize.sh' 
 + 
 +==== cron ==== 
 + 
 +  * Weekly (Sunday) ''07:10:00 AM'' 
 + 
 +  su - 
 + 
 +  ee '/etc/cron.d/mariadb-optimize'
  
 <code> <code>
-Installing MariaDB/MySQL system tables in '/var/db/mysql' ... +
-OK+SHELL=/bin/sh 
 + 
 +10 7 * * sun root '/home/espionage724/.local/scripts/mariadb/optimize.sh' 
 + 
 +# End</code> 
 + 
 +====== Notable Commands ======
  
-To start mariadbd at boot time you have to copy +===== Binaries =====
-support-files/mariadb.service to the right place for your system+
  
 +  pkg info -l 'mariadb118-server' | grep 'bin'
  
-Two all-privilege accounts were created. +  pkg info -'mariadb118-client| grep 'bin'
-One is root@localhost, it has no password, but you need to +
-be system 'rootuser to connect. Use, for example, sudo mysql +
-The second is root@localhost, it has no password either, but +
-you need to be the system 'rootuser to connect. +
-After connecting you can set the password, if you would need to be +
-able to connect as any of these users with a password and without sudo+
  
-See the MariaDB Knowledgebase at https://mariadb.com/kb+===== Settings =====
  
-You can start the MariaDB daemon with: +  su -
-cd '/usr/local' ; /usr/local/bin/mariadbd-safe --datadir='/var/db/mysql'+
  
-You can test the MariaDB daemon with mariadb-test-run.pl +  mariadb-admin variables | egrep 'utf8|networking|socket'
-cd '/usr/local/; perl mariadb-test-run.pl+
  
-Please report any problems at https://mariadb.org/jira+===== Show Users on Server =====
  
-The latest information about MariaDB is available at https://mariadb.org/.+  su -
  
-Consider joining MariaDB's strong and vibrant community: +  mariadb
-https://mariadb.org/get-involved/+
  
-Starting mysql. +  select User,Host from mysql.user;
-</code>+
  
C:/www/wiki/data/attic/servers/bsd/mariadb.1727933859.txt.gz · Last modified: by Sean Rhone

Except where otherwise noted, content on this wiki is licensed under the following license: CC0 1.0 Universal
CC0 1.0 Universal Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki