====== MariaDB 10.5 ====== ===== Installation from Debian 11 repositories ===== - Install MariaDB$ sudo apt update $ sudo apt install mariadb-server - Run the initial security configuration script $ sudo mysql_secure_installation - 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”. - 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**. - 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**. - 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.\\ \\ - When installed from the default repositories, MariaDB will start running automatically. To test this, check its status:$ sudo systemctl status mariadb - 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 - Install [[deb11:phpmyadmin|phpMyAdmin]] - If you are migrating from an old server, follow the [[deb11:migrate#mariadb|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 ===== * [[https://www.digitalocean.com/community/tutorials/how-to-install-mariadb-on-debian-11|How To Install MariaDB on Debian 11]] * [[https://www.tecmint.com/transfer-mysql-databases-from-old-to-new-server/|How to Transfer All MySQL Databases From Old to New Server]] * [[https://dba.stackexchange.com/questions/5666/possible-to-make-mysql-use-more-than-one-core|Possible to make MySQL use more than one core?]] * [[https://dzone.com/articles/how-to-optimize-mysql-queries-for-speed-and-perfor|How to Optimize MySQL Queries for Speed and Performance]] * [[http://www.fromdual.com/innodb-variables-and-status-explained#:~:text=InnoDB%20Buffer%20Pool,bytes%20with%20the%20innodb_buffer_pool_size%20variable.|InnoDB variables and status explained]]