MariaDB 10.3

Installation from Debian 10 repositories

# apt update
# apt install mariadb-server
# mysql_secure_installation

Enter a root password.

phpMyAdmin

# apt update

# apt install phpmyadmin php-mbstring php-gettext
# phpenmod mbstring
# systemctl restart apache2

Select Yes when asked whether to use dbconfig-common to set up the database.

Adjusting User Authentication and Privileges

# mariadb -u root -p
MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION;
MariaDB [(none)]> exit

Securing Your phpMyAdmin Instance

Edit /etc/apache2/conf-available/phpmyadmin.conf:

Alias /phpmyadmin /usr/share/phpmyadmin
<Directory /usr/share/phpmyadmin>
  Options FollowSymLinks
  DirectoryIndex index.php

  # Allow user to access without password
  Include conf-available/user-access.conf

  <IfModule mod_php5.c>
      <IfModule mod_mime.c>
          AddType application/x-httpd-php .php
      </IfModule>
      <FilesMatch ".+\.php$">
          SetHandler application/x-httpd-php
      </FilesMatch>

      php_flag magic_quotes_gpc Off
      php_flag track_vars On
      php_flag register_globals Off
      php_admin_flag allow_url_fopen Off
      php_value include_path .
      php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
      php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/
  </IfModule>
</Directory>

conf-available/user-access.conf contains:

# Allow user to access without password
Require ip www.xx.yyy.zzz

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