{"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
Follow through this guide to learn how to install MariaDB 10.5 on Debian 10 Buster. “MariaDB 10.5<\/a> is the current stable series of MariaDB. It is an evolution of MariaDB 10.4<\/a> with several entirely new features<\/a> not found anywhere else and with backported and reimplemented features from MySQL”<\/em>.<\/p>\n\n\n\n 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 There are two methods in which you can install MariaDB;<\/p>\n\n\n\n MariaDB 10.3 is the currently available version on the default Debian 10 Buster repos;<\/p>\n\n\n\n Therefore, to install MariaDB 10.5, you need to install MariaDB 10.5 APT repos.<\/p>\n\n\n\n Execute the commands below to install MariaDB 10.5 APT repos;<\/p>\n\n\n\n To choose your 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 Resynchronize your package cache;<\/p>\n\n\n\n Install MariaDB 10.5;<\/p>\n\n\n\n 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 Install MariaDB using deb binary files<\/a><\/p>\n\n\n\n Verify the MariaDB installed version.<\/p>\n\n\n\n Upon installation, MariaDB is started and enabled to run on system boot;<\/p>\n\n\n\n You can manage the service via systemctl command. For example, to stop MariaDB service;<\/p>\n\n\n\n To stop the service;<\/p>\n\n\n\n Disable the service from running on system boot;<\/p>\n\n\n\n MariaDB comes with a default security script, Simply run the command below to launch the script.<\/p>\n\n\n\n The new installations of MariaDB have two secure accounts are created during the installation. The accounts are With or<\/p>\n\n\n\n Even if you run, As a user with sudo rights, prefix the commands above with The 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 Similarly, you can login as mysql user;<\/p>\n\n\n\n To completely disable Next time you try to login without specifying the password, login will fail.<\/p>\n\n\n\n You can check our other guides on MariaDB\/MySQL installations by following the links below;<\/p>\n\n\n\n Install MariaDB 10 on Debian 10 Buster<\/a><\/p>\n\n\n\n Install MariaDB 10.4 on Ubuntu 18.04\/Debian 9<\/a><\/p>\n\n\n\n Install MariaDB 10.3 on CentOS 7<\/a><\/p>\n\n\n\n Install MariaDB 10.3 on <\/a>Fedora<\/a> 30<\/a><\/p>\n\n\n\nInstalling MariaDB 10.5 on Debian 10 Buster<\/h2>\n\n\n\n
Run System Update<\/h3>\n\n\n\n
apt update <\/code><\/pre>\n\n\n\n
apt upgrade<\/code><\/pre>\n\n\n\n
\n
Install MariaDB 10.5 from APT Repository<\/h3>\n\n\n\n
apt show mariadb-server<\/code><\/pre>\n\n\n\n
Package: mariadb-server\nVersion: 1:10.3.23-0+deb10u1\nPriority: optional\nSection: database\nSource: mariadb-10.3\nMaintainer: Debian MySQL Maintainers <pkg-mysql-maint@lists.alioth.debian.org>\nInstalled-Size: 67.6 kB\nDepends: mariadb-server-10.3 (>= 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
Install MariaDB 10.5 APT repos on Debian 10 Buster<\/h4>\n\n\n\n
apt install software-properties-common dirmngr<\/code><\/pre>\n\n\n\n
apt-key adv --fetch-keys 'https:\/\/mariadb.org\/mariadb_release_signing_key.asc'<\/code><\/pre>\n\n\n\n
add-apt-repository 'deb [arch=amd64] http:\/\/mirrors.ukfast.co.uk\/sites\/mariadb\/repo\/10.5\/debian<\/a> buster main'<\/code><\/pre>\n\n\n\n
apt update<\/code><\/pre>\n\n\n\n
apt install mariadb-server<\/code><\/pre>\n\n\n\n
Install MariaDB 10.5 using .DEB Binary Files<\/h4>\n\n\n\n
mysql -V<\/code><\/pre>\n\n\n\n
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
Running MariaDB 10.5 on Debian 10 Buster<\/h4>\n\n\n\n
systemctl status mariadb<\/code><\/pre>\n\n\n\n
\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://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[3771]: information_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: mysql\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: performance_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: Phase 6\/7: Checking and upgrading tables\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: Processing databases\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: information_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: performance_schema\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: Phase 7\/7: Running 'FLUSH PRIVILEGES'\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[3771]: OK\nAug 24 17:03:12 debian \/etc\/mysql\/debian-start[4607]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables<\/code><\/pre>\n\n\n\n
systemctl restart mariadb<\/code><\/pre>\n\n\n\n
systemctl stop mariadb<\/code><\/pre>\n\n\n\n
systemctl disable mariadb<\/code><\/pre>\n\n\n\n
Securing MariaDB 10.5<\/h3>\n\n\n\n
mysql_secure_installation <\/code><\/strong>that is used to improve the security of MariaDB installation by:<\/p>\n\n\n\n
\n
mysql_secure_installation<\/code><\/pre>\n\n\n\n
MariaDB Authentication<\/h3>\n\n\n\n
root@localhost<\/code><\/strong> and
mysql@localhost<\/strong><\/code>. Both accounts uses either of the
unix_socket<\/code><\/strong> and the
mysql_native_password<\/code><\/strong> authentication plugins.<\/p>\n\n\n\n
unix_socket<\/strong><\/code> authentication plugin allows a system
root<\/code> user or a
user with sudo rights<\/strong><\/code> to login as
root@locahost<\/strong><\/code> to MariaDB database without a password.<\/p>\n\n\n\n
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
mysql<\/code><\/pre>\n\n\n\n
mysql -u root<\/code><\/pre>\n\n\n\n
mysql -u root -p<\/strong><\/code>, and press ENTER for blank password, you will still login.<\/p>\n\n\n\n
sudo<\/strong><\/code>.<\/p>\n\n\n\n
Enable MariaDB password Authentication<\/h3>\n\n\n\n
mysql_native_password<\/code> plugin is used as a failover for the
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
mysql<\/code><\/pre>\n\n\n\n
set password = password(\"P@sSw0Rd123\");<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
koromicha@debian:~$ mysql -u root -p\nEnter password: ENTER PASSWORD<\/code><\/pre>\n\n\n\n
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 [(none)]><\/code><\/pre>\n\n\n\n
sudo -u mysql mysql<\/code><\/pre>\n\n\n\n
Set Native Password Authentication Method as Default<\/h4>\n\n\n\n
unix_socke<\/code>t authentication plugin and instead use the
msqyl_native_password<\/code> authentication method, simply login to MariaDB and change the authentication plugin for root<\/strong> user.<\/p>\n\n\n\n
mysql<\/code><\/pre>\n\n\n\n
ALTER USER root@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD(\"MyPQQSSword\");<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
sudo mysql -u root<\/code><\/pre>\n\n\n\n
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)<\/code><\/pre>\n\n\n\n