# Install
Code
apt install mariadb-server mariadb-client
# Check service status.
systemctl status mariadb
# Start service.
systemctl start mariadb
# Enable auto start.
systemctl enable mariadb
# Configuration
Code
# Create custom configuration file.
nano -w /etc/mysql/mariadb.conf.d/70-custom.cnf
# And add this there.
[mysqld]
transaction_isolation="READ-COMMITTED"
# Secure installation
Code
# Start secure installation
mysql_secure_installation
1. Enter root password if you have one, or skip by pressing Enter with key authentication only.
2. Don’t switch to 'unix_socket' authentication because MariaDB is already using 'unix_socket' authentication.
3. Don’t change the root password, no need when using unix_socket authentication.
4. Next, you can press Enter to answer all remaining questions, which will remove anonymous user, disable remote root login and remove test database. This step is a basic requirement for MariaDB database security.
# Login and status
Code
# Check MariaDB server version.
mariadb --version
# Test login
mariadb -u root
exit;