<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.bwt.com.de/index.php?action=history&amp;feed=atom&amp;title=MariaDB</id>
	<title>MariaDB - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.bwt.com.de/index.php?action=history&amp;feed=atom&amp;title=MariaDB"/>
	<link rel="alternate" type="text/html" href="https://wiki.bwt.com.de/index.php?title=MariaDB&amp;action=history"/>
	<updated>2026-05-13T20:47:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.bwt.com.de/index.php?title=MariaDB&amp;diff=368&amp;oldid=prev</id>
		<title>BrainwreckedTech: Made TOC float left</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwt.com.de/index.php?title=MariaDB&amp;diff=368&amp;oldid=prev"/>
		<updated>2019-12-11T08:11:52Z</updated>

		<summary type="html">&lt;p&gt;Made TOC float left&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:11, 11 December 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Database]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Database]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div style=&quot;float:&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;right&lt;/del&gt;; margin-&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;left&lt;/del&gt;:0.5em; margin-bottom:0.5em;&quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;div style=&quot;float:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;left&lt;/ins&gt;; margin-&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;right&lt;/ins&gt;:0.5em; margin-bottom:0.5em;&quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MariaDB is a fork of MySQL, a multi-threaded multi-user relational database management system that aims for drop-in compatibility with MySQL.  MySQL was developed by Swedish company MySQL AB in 1995, acquired by Sun Microsystems in 2008, and in turn acquired by Oracle Corporation in 2010.  Due to the conflict of interest between MySQL and Oracle DB, as well as the community&amp;#039;s distrust of Oracle (compounded by lack of response from Oracle during the Sun acquisition), Monty Widenius forked MySQL into MariaDB.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MariaDB is a fork of MySQL, a multi-threaded multi-user relational database management system that aims for drop-in compatibility with MySQL.  MySQL was developed by Swedish company MySQL AB in 1995, acquired by Sun Microsystems in 2008, and in turn acquired by Oracle Corporation in 2010.  Due to the conflict of interest between MySQL and Oracle DB, as well as the community&amp;#039;s distrust of Oracle (compounded by lack of response from Oracle during the Sun acquisition), Monty Widenius forked MySQL into MariaDB.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key MW_BWT:diff:1.41:old-343:rev-368:php=table --&gt;
&lt;/table&gt;</summary>
		<author><name>BrainwreckedTech</name></author>
	</entry>
	<entry>
		<id>https://wiki.bwt.com.de/index.php?title=MariaDB&amp;diff=343&amp;oldid=prev</id>
		<title>BrainwreckedTech: Created page.</title>
		<link rel="alternate" type="text/html" href="https://wiki.bwt.com.de/index.php?title=MariaDB&amp;diff=343&amp;oldid=prev"/>
		<updated>2019-12-09T00:17:30Z</updated>

		<summary type="html">&lt;p&gt;Created page.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Database]]&lt;br /&gt;
&amp;lt;div style=&amp;quot;float:right; margin-left:0.5em; margin-bottom:0.5em;&amp;quot;&amp;gt;__TOC__&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
MariaDB is a fork of MySQL, a multi-threaded multi-user relational database management system that aims for drop-in compatibility with MySQL.  MySQL was developed by Swedish company MySQL AB in 1995, acquired by Sun Microsystems in 2008, and in turn acquired by Oracle Corporation in 2010.  Due to the conflict of interest between MySQL and Oracle DB, as well as the community&amp;#039;s distrust of Oracle (compounded by lack of response from Oracle during the Sun acquisition), Monty Widenius forked MySQL into MariaDB.&lt;br /&gt;
&lt;br /&gt;
MariaDB is a middle ground (of sorts) between SQLite&amp;#039;s easier setup and lesser performance and resiliency, and PostgreSQL&amp;#039;s increased capabilities and complexity.&lt;br /&gt;
&lt;br /&gt;
= Prerequisites =&lt;br /&gt;
&lt;br /&gt;
* If using BTRFS, disable Copy-On-Write for the {{ic|datadir}}.&lt;br /&gt;
* If using ZFS, create a dataset for the {{ic|datadir}} using {{ic|1=-o recordsize=8K -o primarycache=metadata -o logbias=throughput}}.&lt;br /&gt;
&lt;br /&gt;
= Required Packages =&lt;br /&gt;
&lt;br /&gt;
{{bc|sudo pacman -Syu mariadb}}&lt;br /&gt;
&lt;br /&gt;
= Configuration =&lt;br /&gt;
&lt;br /&gt;
== Data Directory ==&lt;br /&gt;
&lt;br /&gt;
If you want to put your databases somewhere other than the default {{ic|/var/lib/mysql}}:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
sudo mkdir &amp;lt;dir&amp;gt;&lt;br /&gt;
sudo chown -R mysql:mysql &amp;lt;dir&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== tmpfs for tmpdir ==&lt;br /&gt;
&lt;br /&gt;
The directory used by MariaDB for storing temporary files is named tmpdir. For example, it is used to perform disk based large sorts, as well as for internal and explicit temporary tables.&lt;br /&gt;
&lt;br /&gt;
Create the directory with appropriate permissions:&lt;br /&gt;
&lt;br /&gt;
{{bc|&lt;br /&gt;
sudo mkdir -pv &amp;lt;dir&amp;gt;&lt;br /&gt;
sudo chown mysql:mysql &amp;lt;dir&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Find the id and gid of the mysql user and group:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ id mysql|2=&lt;br /&gt;
uid=27(mysql) gid=27(mysql) groups=27(mysql)}}&lt;br /&gt;
&lt;br /&gt;
Add to your {{ic|/etc/fstab}} file.&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/fstab|2=&lt;br /&gt;
...&lt;br /&gt;
tmpfs	/srv/sqltmp	tmpfs	rw,noatime,gid=27,uid=27,size=100M,mode=0750	0 0&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=If you are using ZFS, add&amp;lt;tt&amp;gt; x-systemd.after=zfs-mount.service &amp;lt;/tt&amp;gt;to the list of mount options}}&lt;br /&gt;
&lt;br /&gt;
== Configuration File ==&lt;br /&gt;
&lt;br /&gt;
{{hc|/etc/my.cnf.d/server.cnf|2=&lt;br /&gt;
...&lt;br /&gt;
[mysqld]&lt;br /&gt;
datadir=/srv/mdb&lt;br /&gt;
skip-networking&lt;br /&gt;
tmpdir=/srv/mdb/tmp&lt;br /&gt;
innodb_file_per_table=1&lt;br /&gt;
innodb_file_format=Barracuda&lt;br /&gt;
# ZFS-specific&lt;br /&gt;
skip-innodb_doublewrite&lt;br /&gt;
innodb_use_native_aio=0&lt;br /&gt;
innodb_use_atomic_writes=0&lt;br /&gt;
...&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{note|1=The&amp;lt;tt&amp;gt; skip-networking &amp;lt;/tt&amp;gt;option means the database will be unavailable over TCP.  Local programs that need access must use the UNIX socket.}}&lt;br /&gt;
&lt;br /&gt;
== Initial Setup ==&lt;br /&gt;
&lt;br /&gt;
{{bc|&amp;lt;nowiki&amp;gt;sudo mariadb-install-db --user=mysql --basedir=/usr --datadir=&amp;lt;dir&amp;gt;&amp;lt;/nowiki&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
== Start the Server ==&lt;br /&gt;
&lt;br /&gt;
{{bc|sudo systemctl enable --now mariadb}}&lt;br /&gt;
&lt;br /&gt;
== Security Settings ==&lt;br /&gt;
&lt;br /&gt;
{{bc|sudo mysql_secure_installation}}&lt;br /&gt;
&lt;br /&gt;
Create a user:&lt;br /&gt;
&lt;br /&gt;
{{hc|$ mysql -u root -p|2=&lt;br /&gt;
MariaDB&amp;gt; CREATE USER &amp;#039;&amp;lt;user&amp;gt;&amp;#039;@&amp;#039;localhost&amp;#039; IDENTIFIED BY &amp;#039;&amp;lt;password&amp;gt;&amp;#039;;&lt;br /&gt;
MariaDB&amp;gt; GRANT ALL PRIVILEGES ON &amp;lt;database&amp;gt;.* TO &amp;#039;&amp;lt;USER&amp;gt;&amp;#039;@&amp;#039;localhost&amp;#039;;&lt;br /&gt;
MariaDB&amp;gt; FLUSH PRIVILEGES;&lt;br /&gt;
MariaDB&amp;gt; quit&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>BrainwreckedTech</name></author>
	</entry>
</feed>