<p>
MariaDB is a relational database.<br />
It is free, the source code is open, and it is popular<br />
for providing data on web servers.
</p>

<h3>Installation</h3>
<p>
The official Debian repository contains MariaDB:
</p>
<pre><code class="language-bash">apt install mariadb-server mariadb-client</code></pre>
<p>
To have a secure setup of the installation, execute:
</p>
<pre><code class="language-bash">mysql_secure_installation</code></pre>

<h3>Create Users and Databases</h3>
<p>
Open the SQL command prompt:
</p>
<pre><code class="language-bash">mysql -u root [-p]</code></pre>
<p>
Create a new user:
</p>
<pre><code class="language-sql">CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';</code></pre>
<p>
Create a new database:
</p>
<pre><code class="language-sql">CREATE DATABASE mydb;</code></pre>
<p>
Allow the new user to access the created database:
</p>
<pre><code class="language-sql">GRANT ALL PRIVILEGES ON mydb.* TO 'user'@'localhost';
FLUSH PRIVILEGES;
</code></pre>

<h3>Backup and Restore</h3>
<p>
Dump a database to an SQL script and compress it:
</p>
<pre><code class="language-bash">mysqldump -u user -p mydb | gzip &gt; mydb.sql.gz</code></pre>
<p>
Decompress and execute the SQL script to restore the database:
</p>
<pre><code class="language-bash">zcat mydb.sql.gz | mysql -u user -p mydb</code></pre>

<h3>PHP</h3>
<p>
To access a MariaDB database from PHP, install the connector:
</p>
<pre><code class="language-bash">apt install php-mysql</code></pre>

<h3>External Links</h3>
<ul>
<li><a href="https://mariadb.org/" target="_blank">
https://mariadb.org/</a></li>
</ul>