MariaDB is an open-source relational database management system, backward compatible, binary drop-in replacement of MySQL. In addition, it is developed by some of the original developers of MySQL and by many contributors from the community.
In this tutorial, we will explain how to install and secure MariaDB 10.5 on Ubuntu 20.04.
Install MariaDB 10.5 on Ubuntu 20.04 LTS
01- First, update the system and install software-properties-common
package
$ sudo apt update && sudo apt upgrade $ sudo apt -y install software-properties-common
02- Run the below command to import the Mariadb repository GPG key:
$ sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
03- After importing of the repository GPG key, add the APT repository by running the following command:
sudo add-apt-repository 'deb [arch=amd64] http://mariadb.mirror.globo.tech/repo/10.5/ubuntu focal main'
04- Run the following command as root or user with sudo privileges to install MariaDB 10.5 on Ubuntu 20:
$ sudo apt update $ sudo apt install mariadb-server mariadb-client
05- Once the installation is complete, start the MariaDB service and enable it to automatically start on boot by typing:
$ systemctl enable mysql --now
06-To verify that the MariaDB server is running, type:
$ sudo systemctl status mysql ● mariadb.service - MariaDB 10.5.2 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: active (running) since Sat 2020-04-25 23:57:39 UTC; 2min 8s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 4309 (mysqld) Status: "Taking your SQL requests now..." Tasks: 11 (limit: 2344) Memory: 82.5M CGroup: /system.slice/mariadb.service └─4309 /usr/sbin/mysqld
07- Finally, verify the login to MariaDB server using mysql
tool:
$ mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 56 Server version: 10.5.2-MariaDB-1:10.5.2+maria~focal-log mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
Conclusion
You have successfully installed MariaDB 10.5 on Ubuntu 20.04. You might want to check the following guides: