MariaDB server is a community developed fork of MySQL server. Started by core members of the original MySQL team, MariaDB is designed as a drop-in replacement of MySQL(R) with more features, new storage engines, fewer bugs, and better performance.
MariaDB can be an better choice for choice for database professionals looking for a robust, scalable, and reliable SQL server.
In this tutorial, we will explain how to install the latest version of MariaDB on a Ubuntu 18.04 LTS server.
You’ll need to be logged in as a user with sudo access to be able to install MariaDB Server on your Ubuntu system.
Step 1./ Installing MariaDB Server
Before we start, visit the MariaDB Repository page and check if there is a new version available.
– First add the MariaDB GPG key to your system using the following command:
$ sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
– Once the key is imported, add the MariaDB repository with the bellow command:
$ sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el] http://ftp.utexas.edu/mariadb/repo/10.3/ubuntu bionic main'
If you get an error message saying
add-apt-repository command not found then install the
– To be able to install packages from the MariaDB repository you’ll need to update the packages list like below:
$ apt update
– Finaly, install MariaDB Server package using the following command
$ apt install mariadb-server
– You will be prompted to provide MariaDB root password like below
– Repeat the password and Press
<ok> to confirm the new password and finish the MariaDB Server installation.
– The MariaDB service will start automatically, to verify it type:
$ systemctl status mariadb ● mariadb.service - MariaDB 10.3.12 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 Sun 2019-01-20 18:04:38 UTC; 28s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 5341 (mysqld) Status: "Taking your SQL requests now..." Tasks: 32 (limit: 1005) CGroup: /system.slice/mariadb.service └─5341 /usr/sbin/mysqld
– To check the MariaDB Server version run:
$ sudo mysql -V mysql Ver 15.1 Distrib 10.3.12-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
Step 2./ Securing MariaDB Server
– To improve the security of the MariaDB installation, run the
mysql_secure_installation. Check out our previous tutorial: Securing MySQL server / Mariadb with mysql_secure_installation
Step 3./ Connecting to MariaDB Server
– To connect to the MariaDB Server through the terminal we can use the MariaDB client. To log in to the MariaDB Server as the root user type:
$ mysql -u root -p Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 49 Server version: 10.3.12-MariaDB Ubuntu 18.04 Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
You will be prompted to enter the root password you have previously set.
Now that your MariaDB Server is up and running, you might want to check the following guides:
- How to Setup MariaDB Master-Slave Replication
- How To Reset MySQL or MariaDB Root Password
- How to Install LAMP Stack on Ubuntu 18.04
We hope this tutorial was enough Helpful. If you need more information, or have any questions, just comment below and we will be glad to assist you!
PS. If you like this post please share it with your friends on the social networks using the buttons below.Thanks.