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.
It is built upon the values of performance, stability, and openness, and MariaDB Foundation ensures contributions will be accepted on technical merit. Recent new functionality includes advanced clustering with Galera Cluster 4, compatibility features with Oracle Database and Temporal Data Tables, allowing one to query the data as it stood at any point in the past.
Welcome to today’s topic on how to install MariaDB 10.08 on Fedora 35 distribution.
Installing MariaDB on Fedora 35
To install MariaDB 10.8 Alpha, we can first have to update the system repositories to make our system up to date.
$ sudo dnf update -y
I am going to install MariaDB from the Modular repository in order to enable install the version I require.
List available versions of MariaDB.
To begin with we need to list the available versions of MariaDB. Open your terminal and type the following command;
$ sudo dnf modular list mariadb
You will get the following output.
Output Fedora Modular 35 - x86_64 Name Stream Profiles Summary mariadb 10.3 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server mariadb 10.4 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server mariadb 10.5 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server Fedora Modular 35 - x86_64 - Updates Name Stream Profiles Summary mariadb 10.3 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server mariadb 10.4 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server mariadb 10.5 client, devel, galera, server [d] MariaDB: a very fast and robust SQL database server mariadb 10.6 client, devel, galera, server MariaDB: a very fast and robust SQL database server mariadb 10.7 client, devel, galera, server MariaDB: a very fast and robust SQL database server Hint: [d]efault, [e]nabled, [x]disabled, [i]nstalled
In order to enable the MariaDB, you need to use and set stream RPMs you will have to enable with the following command;
$ sudo dnf module enable mariadb:10.7
Output Package Architecture Version Repository Size ================================================================================================================= Enabling module streams: mariadb 10.7 Transaction Summary ================================================================================================================= Is this ok [y/N]: y Complete!
Now that we have enabled the MariaDB version we would like to use, check if the server version is also available.
$ sudo dnf list mariadb-server
Output Available Packages mariadb-server.x86_64 3:10.7.1-1.module_f35+13505+f0394ab9 updates-modular
For us, we have our Mariadb server available.
Install MariaDB Server
To install MariaDB run the following command on your terminal.
$ sudo dnf module install mariadb/server
When the installation is complete, it’s now time to enable MariaDB.
Configuring MariaDB 10.7
Enable MariaDB service at boot. To do so run the following on your terminal.
$ sudo systemctl enbale mariadb
Then start the MariaDB service with the following command;
$ sudo systemctl start mariadb
Lastly, you can check the status of MariaDB with the following;
$ sudo systemctl status mariadb
Output ● mariadb.service - MariaDB 10.7 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since Sat 2021-12-25 07:32:13 UTC; 1min 29s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 19900 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 19922 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCE> Process: 20015 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) Main PID: 20004 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 9 (limit: 1112) Memory: 121.1M CPU: 1.048s CGroup: /system.slice/mariadb.service └─20004 /usr/libexec/mariadbd --basedir=/usr Dec 25 07:32:13 fedora mariadb-prepare-db-dir: See the MariaDB Knowledgebase at https://mariadb.com/kb or> Dec 25 07:32:13 fedora mariadb-prepare-db-dir: MySQL manual for more instructions. Dec 25 07:32:13 fedora mariadb-prepare-db-dir: Please report any problems at https://mariadb.org/jira Dec 25 07:32:13 fedora mariadb-prepare-db-dir: The latest information about MariaDB is available at https> Dec 25 07:32:13 fedora mariadb-prepare-db-dir: You can find additional information about the MySQL part a> Dec 25 07:32:13 fedora mariadb-prepare-db-dir: https://dev.mysql.com Dec 25 07:32:13 fedora mariadb-prepare-db-dir: Consider joining MariaDB's strong and vibrant community: Dec 25 07:32:13 fedora mariadb-prepare-db-dir: https://mariadb.org/get-involved/ Dec 25 07:32:13 fedora mariadbd: 2021-12-25 7:32:13 0 [Note] /usr/libexec/mariadbd (server 10.7.1-MariaD> Dec 25 07:32:13 fedora systemd: Started MariaDB 10.7 database server.
If it happens you are getting service not active, repeat the following steps to enable the service again.
Configure SQL before use.
Before using MariaDB run secure installation command to run basic configuration. Use the following command to do so;
$ sudo mysql_secure_installation
Follow all the prompts to run a secure installation.
Output NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] n ... skipping. By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB!
In order to run SQL use the following command;
$ sudo mysql -u root -p
If you didn’t set the password use the above command.
Output Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.7.1-MariaDB MariaDB Server 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)]>
We have successfully installed and configured MariaDB 10.7 on our Fedora 35 distribution. Continue exploring different SQL commands to learn more. In case of issues contact us or consult MariaDB documentation.