MariaDB 10.5

Installation from Debian 11 repositories

  1. Install MariaDB
    $ sudo apt update
    $ sudo apt install mariadb-server
  2. Run the initial security configuration script
    $ sudo mysql_secure_installation
    1. The first prompt will ask you to enter the current database root password. Since you have not set one up yet, press ENTER to indicate “none”.
    2. You’ll be asked if you want to switch to unix socket authentication. Since you already have a protected root account, you can skip this step. Type n and then press ENTER.
    3. The next prompt asks you whether you’d like to change the root password. On Debian 11, the root account for MariaDB is tied closely to automated system maintenance, so you should not change the configured authentication methods for that account. Doing so would make it possible for a package update to break the database system by removing access to the administrative account. Type n and then press ENTER.
    4. From there, you can press y and then ENTER to accept the defaults for all the subsequent questions. This will remove some anonymous users and the test database, disable remote root logins, and load these new rules so that MariaDB immediately implements the changes you have made.

  3. When installed from the default repositories, MariaDB will start running automatically. To test this, check its status:
    $ sudo systemctl status mariadb
  4. We will create a new account called user with the same capabilities as the root account, but configured for password authentication. Open up the MariaDB prompt from your terminal:
    $ sudo mariadb
    MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
    MariaDB [(none)]> FLUSH PRIVILEGES;
    MariaDB [(none)]> exit
  5. Install phpMyAdmin
  6. If you are migrating from an old server, follow the How to migrate a (web) server guide

Settings

  • Modify the following in /etc/mysql/mariadb.conf.d/50-server.conf
    # * Query Cache Configuration
    query_cache_limit = 64M
    query_cache_size = 256M
    # * InnoDB
    innodb_buffer_pool_size = 1024M
    # * Aria
    aria_pagecache_buffer_size = 256M
  • On my Debian 9 server with MariaDB 10.1 I had occasional db crashes with *** buffer overflow detected ***, so I added a CRON job to restart MariaDB once a week.

Trouble shooting