{"id":6798,"date":"2020-08-24T22:20:51","date_gmt":"2020-08-24T19:20:51","guid":{"rendered":"https:\/\/kifarunix.com\/?p=6798"},"modified":"2024-03-14T22:21:40","modified_gmt":"2024-03-14T19:21:40","slug":"install-mariadb-10-5-on-debian-10-buster","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-mariadb-10-5-on-debian-10-buster\/","title":{"rendered":"Install MariaDB 10.5 on Debian 10 Buster"},"content":{"rendered":"\n<p>Follow through this guide to learn how to install MariaDB 10.5 on Debian 10 Buster. &#8220;<em><a href=\"https:\/\/mariadb.com\/kb\/en\/what-is-mariadb-105\/\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB 10.5<\/a>&nbsp;is the current&nbsp;stable&nbsp;series of MariaDB. It is an evolution of&nbsp;<a href=\"https:\/\/mariadb.com\/kb\/en\/what-is-mariadb-104\/\" target=\"_blank\" rel=\"noopener\">MariaDB 10.4<\/a>&nbsp;with several entirely <a href=\"https:\/\/mariadb.com\/kb\/en\/changes-improvements-in-mariadb-105\/\" target=\"_blank\" rel=\"noreferrer noopener\">new features<\/a> not found anywhere else and with backported and reimplemented features from MySQL&#8221;<\/em>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing MariaDB 10.5 on Debian 10 Buster<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Run System Update<\/h3>\n\n\n\n<p>Assuming that you are installing MariaDB 10.5 on a newly installed Debian 10 buster, update and upgrade your system packages.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt upgrade<\/code><\/pre>\n\n\n\n<p>There are two methods in which you can install MariaDB;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"#install-mariadb-10.5-from-apt-repos\">Install MariaDB from MariaDB APT repository<\/a><\/li>\n\n\n\n<li><a href=\"#install-mariadb-10.5-using-deb-binary\">Install MariaDB using MariaDB .DEB Binary file<\/a><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-mariadb-10.5-from-apt-repos\">Install MariaDB 10.5 from APT Repository<\/h3>\n\n\n\n<p>MariaDB 10.3 is the currently available version on the default Debian 10 Buster repos;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt show mariadb-server<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Package: mariadb-server\nVersion: 1:10.3.23-0+deb10u1\nPriority: optional\nSection: database\nSource: mariadb-10.3\nMaintainer: Debian MySQL Maintainers &lt;pkg-mysql-maint@lists.alioth.debian.org&gt;\nInstalled-Size: 67.6 kB\nDepends: mariadb-server-10.3 (&gt;= 1:10.3.23-0+deb10u1)\nHomepage: https:\/\/mariadb.org\/\nTag: devel::lang:c++, devel::lang:sql, devel::library, implemented-in::c++,\n interface::commandline, interface::daemon, network::server\n protocol::db:mysql, role::devel-lib, role::metapackage, role::program,\n works-with::db\nDownload-Size: 31.0 kB\nAPT-Sources: http:\/\/deb.debian.org\/debian buster\/main amd64 Packages<\/code><\/pre>\n\n\n\n<p>Therefore, to install MariaDB 10.5, you need to install MariaDB 10.5 APT repos.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Install MariaDB 10.5 APT repos on Debian 10 Buster<\/h4>\n\n\n\n<p>Execute the commands below to install MariaDB 10.5 APT repos;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install software-properties-common dirmngr<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt-key adv --fetch-keys 'https:\/\/mariadb.org\/mariadb_release_signing_key.asc'<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>add-apt-repository 'deb [arch=amd64] <a href=\"http:\/\/mirrors.ukfast.co.uk\/sites\/mariadb\/repo\/10.5\/debian\" target=\"_blank\" rel=\"noopener\">http:\/\/mirrors.ukfast.co.uk\/sites\/mariadb\/repo\/10.5\/debian<\/a> buster main'<\/code><\/pre>\n\n\n\n<p>To choose your <a href=\"https:\/\/downloads.mariadb.org\/mariadb\/repositories\" target=\"_blank\" rel=\"noreferrer noopener\">MariaDB mirrors<\/a>, head over to MariaDB repositories site, choose your Linux distro, distro release, MariaDB version to install and finally the Mirrors to use.<\/p>\n\n\n\n<p>Resynchronize your package cache;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt update<\/code><\/pre>\n\n\n\n<p>Install MariaDB 10.5;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>apt install mariadb-server<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"install-mariadb-10.5-using-deb-binary\">Install MariaDB 10.5 using .DEB Binary Files<\/h4>\n\n\n\n<p>While this is not the recommended way of installing MariaDB, you can as well download .deb binary files and install it. Follow the link below to learn how to install MariaDB using the .deb files.<\/p>\n\n\n\n<p><a href=\"https:\/\/mariadb.com\/kb\/en\/installing-mariadb-deb-files\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install MariaDB using deb binary files<\/a><\/p>\n\n\n\n<p>Verify the MariaDB installed version.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -V<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql Ver 15.1 Distrib 10.5.5-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Running MariaDB 10.5 on Debian 10 Buster<\/h4>\n\n\n\n<p>Upon installation, MariaDB is started and enabled to run on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl status mariadb<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\u25cf mariadb.service - MariaDB 10.5.5 database server\n   Loaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled)\n  Drop-In: \/etc\/systemd\/system\/mariadb.service.d\n           \u2514\u2500migrated-from-my.cnf-settings.conf\n   Active: active (running) since Mon 2020-08-24 17:02:06 EDT; 43min ago\n     Docs: man:mariadbd(8)\n           https:&#47;&#47;mariadb.com\/kb\/en\/library\/systemd\/\n Main PID: 3750 (mariadbd)\n   Status: \"Taking your SQL requests now...\"\n    Tasks: 9 (limit: 1149)\n   Memory: 83.2M\n   CGroup: \/system.slice\/mariadb.service\n           \u2514\u25003750 \/usr\/sbin\/mariadbd\n\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: information_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: mysql\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: performance_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: Phase 6\/7: Checking and upgrading tables\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: Processing databases\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: information_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: performance_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: Phase 7\/7: Running 'FLUSH PRIVILEGES'\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;3771]: OK\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start&#91;4607]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables<\/code><\/pre>\n\n\n\n<p>You can manage the service via systemctl command. For example, to stop MariaDB service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl restart mariadb<\/code><\/pre>\n\n\n\n<p>To stop the service;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl stop mariadb<\/code><\/pre>\n\n\n\n<p>Disable the service from running on system boot;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>systemctl disable mariadb<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Securing MariaDB 10.5<\/h3>\n\n\n\n<p>MariaDB comes with a default security script,&nbsp;<strong><code>mysql_secure_installation&nbsp;<\/code><\/strong>that is used to improve the security of MariaDB installation by:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Setting the password for root accounts (if need be).<\/li>\n\n\n\n<li>Disabling remote root login to the databases.<\/li>\n\n\n\n<li>Removing anonymous-user accounts.<\/li>\n\n\n\n<li>Removing the test database, which by default can be accessed by anonymous users.<\/li>\n<\/ul>\n\n\n\n<p>Simply run the command below to launch the script.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql_secure_installation<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">MariaDB Authentication<\/h3>\n\n\n\n<p>The new installations of MariaDB have two secure accounts are created during the installation. The accounts are&nbsp;<strong><code>root@localhost<\/code><\/strong>&nbsp;and <code><strong>mysql@localhost<\/strong><\/code>. Both accounts uses either of the&nbsp;<strong><code>unix_socket<\/code><\/strong>&nbsp;and the&nbsp;<strong><code>mysql_native_password<\/code><\/strong>&nbsp;authentication plugins.<\/p>\n\n\n\n<p><code><strong>unix_socket<\/strong><\/code>&nbsp;authentication plugin allows a system <code>root<\/code> user or a <code><strong>user with sudo rights<\/strong><\/code> to login as&nbsp;<code><strong>root@locahost<\/strong><\/code>&nbsp;to MariaDB database without a password.<\/p>\n\n\n\n<p>With <code><strong>unix_socket<\/strong><\/code> authentication plugin, while being a root user, you can simply login by running either of the commands below;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql<\/code><\/pre>\n\n\n\n<p>or<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql -u root<\/code><\/pre>\n\n\n\n<p>Even if you run, <code><strong>mysql -u root -p<\/strong><\/code>, and press ENTER for blank password, you will still login.<\/p>\n\n\n\n<p>As a user with sudo rights, prefix the commands above with <code><strong>sudo<\/strong><\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Enable MariaDB password Authentication<\/h3>\n\n\n\n<p>The&nbsp;<code>mysql_native_password<\/code>&nbsp;plugin is used as a failover for the <code>unix_socket<\/code> plugin. However, the account has an invalid password. To enable password authentication, you need to login to MariaDB as root user as shown above and set the password.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>set password = password(\"P@sSw0Rd123\");<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<p>This re-enables the MariaDB password authentication and hence, you can now login as non root or non sudo user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>koromicha@debian:~$ mysql -u root -p\nEnter password: ENTER PASSWORD<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>Welcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 39\nServer version: 10.5.5-MariaDB-1:10.5.5+maria~buster mariadb.org binary distribution\n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\n\nMariaDB &#91;(none)]&gt;<\/code><\/pre>\n\n\n\n<p>Similarly, you can login as mysql user;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo -u mysql mysql<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Set Native Password Authentication Method as Default<\/h4>\n\n\n\n<p>To completely disable <code>unix_socke<\/code>t authentication plugin and instead use the&nbsp;<code>msqyl_native_password<\/code>&nbsp;authentication method, simply login to MariaDB and change the authentication plugin for <strong>root<\/strong> user.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>mysql<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD(\"MyPQQSSword\");<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>flush privileges;\nquit<\/code><\/pre>\n\n\n\n<p>Next time you try to login without specifying the password, login will fail.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>sudo mysql -u root<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)<\/code><\/pre>\n\n\n\n<p>You can check our other guides on MariaDB\/MySQL installations by following the links below;<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-on-debian-10-buster\/\" target=\"_blank\">Install MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-4-on-ubuntu-18-04-debian-9\/\" target=\"_blank\">Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-centos-7\/\" target=\"_blank\">Install MariaDB 10.3 on CentOS 7<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\">Install MariaDB 10.3 on&nbsp;<\/a><a href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\" target=\"_blank\" rel=\"noreferrer noopener\">Fedora<\/a><a href=\"https:\/\/kifarunix.com\/install-mariadb-10-3-on-fedora-30\/\">&nbsp;30<\/a><\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/install-mysql-8-on-centos-8\/\" target=\"_blank\" rel=\"noreferrer noopener\">Install MySQL 8 on CentOS 8<\/a><\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/kifarunix.com\/install-mysql-8-on-debian-10-buster\/\" target=\"_blank\">Install MySQL 8 on Debian 10 Buster<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Follow through this guide to learn how to install MariaDB 10.5 on Debian 10 Buster. &#8220;MariaDB 10.5&nbsp;is the current&nbsp;stable&nbsp;series of MariaDB. It is an evolution<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,299,928],"tags":[1000,1039,1932,1933,1935],"class_list":["post-6798","post","type-post","status-publish","format-standard","hentry","category-howtos","category-database","category-mariadb","tag-database","tag-debian-10-buster","tag-install-mariadb-10-5","tag-install-mariadb-10-5-on-debian-10","tag-mariadb-10-5","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/6798"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=6798"}],"version-history":[{"count":5,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/6798\/revisions"}],"predecessor-version":[{"id":21466,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/6798\/revisions\/21466"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=6798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=6798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=6798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}