In this article from the Orcacore, we want to teach you How to install MariaDB on Ubuntu 20.04.
Let’s see what MariaDB is in a quick view.
What is MariaDB?
MariaDB Server is one of the most popular open-source relational databases. It’s made by the original developers of MySQL and guaranteed to stay open source. It is part of most cloud offerings and the default in most Linux distributions.
Install MariaDB Server on Ubuntu 20.04 LTS
Requirements for installing MariaDB
Getting started installing MariaDB on Ubuntu 20.04
For installing MariaDB, first, you should update the index packages with the following command:
sudo apt update
Then install the MariaDB package with the following command:
sudo apt install mariadb-server
Now MariaDB on Ubuntu 20.04 is installed but it will not ask you to set passwords or any other changes.
Configuration MariaDB Server on Ubuntu 20.04
In this step you need to run security scrips for the new MariaDB installation with the following command:
This will ask you to make some changes like the database root password. Because you have not set up a password above press Enter for none to continue.
After that, you will be asked to set up a root password type N to continue.
Create an administrative user in your MariaDB
In this step, you can create a new account called admin with the same privileges as the root account with password authentication.
Open MariaDB on Ubuntu 20.04with the following command:
Then create a new user with root privileges and password-based access with the following command:
GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Then flush the privileges with the following command:
To exit from the MariaDB shell run the following command:
Now you can test your MariaDB.
Test MariaDB on Ubuntu 20.04
When the installation is finished MariaDB starts running automatically, you can check this with the following command:
sudo systemctl status mariadb
You will see the active running in your output.
Note: If your MariaDB isn’t running you can use the following command to start it.
sudo systemctl start mariadb
You can use the MySQL admin tool that lets you run administrative commands.
sudo mysqladmin version
Or with an administrative user, you can run the following command:
mysqladmin -u admin -p version
In this article, we try to quick overview of what’s MariaDB Server and how to install it on Ubuntu 20.04.
Hope you enjoy this article about How to install MariaDB on Ubuntu 20.04.
Also, If you need to install MariaDB on other Linux distros, you can follow the below links: