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/01 22:24] Sean Rhoneservers:bsd:mariadb [2026/01/09 17:24] (current) – [Script] Sean Rhone
Line 1: Line 1:
-  * TODO (copy of mysql)+====== Information ======
  
-<code> +  * MariaDB ((https://mariadb.org/)) 
-root@Spinesnap:~ # service 'mysql-server' start +  * Server 
-Installing MariaDB/MySQL system tables in '/var/db/mysql' ... +  * [[information:realm_of_espionage|Realm of Espionage]]
-OK+
  
-To start mariadbd at boot time you have to copy +===== Prerequisites =====
-support-files/mariadb.service to the right place for your system+
  
 +  * [[bsd:server:freebsd_16.0|FreeBSD 16.0]]
  
-Two all-privilege accounts were created. +====== Dependencies ======
-One is root@localhost, it has no password, but you need to +
-be system 'root' user to connect. Use, for example, sudo mysql +
-The second is root@localhost, it has no password either, but +
-you need to be the system 'root' user 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+  su -
  
-You can start the MariaDB daemon with: +  pkg install 'mariadb118-server'
-cd '/usr/local' ; /usr/local/bin/mariadbd-safe --datadir='/var/db/mysql'+
  
-You can test the MariaDB daemon with mariadb-test-run.pl +====== Settings ======
-cd '/usr/local/' ; perl mariadb-test-run.pl+
  
-Please report any problems at https://mariadb.org/jira+  su -
  
-The latest information about MariaDB is available at https://mariadb.org/.+  ee '/usr/local/etc/mysql/conf.d/custom.cnf'
  
-Consider joining MariaDB's strong and vibrant community: +<code> 
-https://mariadb.org/get-involved/+[client] 
 +default-character-set = 'utf8mb4'
  
-Starting mysql. +[mariadb-client] 
-</code>+default-character-set = 'utf8mb4'
  
-  service 'mysql-server' status+[mariadbd] 
 +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 = 'Off' 
 +table_definition_cache = '1400' 
 + 
 +# End</code> 
 + 
 +====== Service ====== 
 + 
 +===== Initial ===== 
 + 
 +  su -
  
   sysrc mysql_enable="YES"   sysrc mysql_enable="YES"
Line 42: Line 50:
   service 'mysql-server' start   service 'mysql-server' start
  
-  mysql_secure_installation+===== Status ===== 
 + 
 +  su - 
 + 
 +  service 'mysql-server' status 
 + 
 +====== Initial Setup ====== 
 + 
 +  su - 
 + 
 +  mariadb-secure-installation 
 + 
 +====== Database Repair and Optimization ====== 
 + 
 +===== One-shot ===== 
 + 
 +  su - 
 + 
 +  mariadb-check -o -A -f -e --auto-repair 
 + 
 +===== cron ===== 
 + 
 +==== Script ==== 
 + 
 +  mkdir -p ~/'.local/scripts/mariadb' && ee ~/'.local/scripts/mariadb/optimize.sh' && chmod +x ~/'.local/scripts/mariadb/optimize.sh' 
 + 
 +<code> 
 +#!/bin/sh 
 + 
 +'/usr/local/bin/mariadb-check' -o -A -f -e --auto-repair > '/dev/null' 
 + 
 +'/bin/sync' 
 + 
 +# 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> 
 +
 +SHELL=/bin/sh 
 + 
 +10 7 * * sun root '/home/espionage724/.local/scripts/mariadb/optimize.sh' 
 + 
 +# End</code> 
 + 
 +====== Notable Commands ====== 
 + 
 +===== Binaries ===== 
 + 
 +  pkg info -l 'mariadb118-server' | grep 'bin' 
 + 
 +  pkg info -l 'mariadb118-client' | grep 'bin' 
 + 
 +===== Settings ===== 
 + 
 +  su -
  
-  mysqladmin+  mariadb-admin variables | egrep 'utf8|networking|socket'
  
-  mysqlcheck -u 'root' -p -o -A -f -e --auto-repair+===== Show Users on Server =====
  
-  mysqladmin -u 'root' -p variables | egrep 'utf8|networking|socket'+  su -
  
-  /tmp/mysql.sock+  mariadb
  
-  /tmp/mysqlx.sock+  select User,Host from mysql.user;
  
C:/www/wiki/data/attic/servers/bsd/mariadb.1727835889.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