# Getting Started With MariaDB On Fedora

This document will show you how to install and get started with MariaDB on Fedora.

### Introduction

Many applications require a database on the backend. The reason for this is that they save user data and this data needs to reside in a database. This could be a web app you wrote, Wordpress, or something else entirely. It is important to know how to install a database and work with it.

### Installing The Services

Heavily used applications often need a database server. This is a dedicated physical or virtual machine that just runs the database. If this is a small project, then you can certainly run the database on the same infrastructure as the application itself.

To install the services:

dnf install mariadb mariadb-server

If you are separating the infrastructure, install mariadb on the client too.

Once installed, you can check the version.

mariadb –version

### Enabling The Service

The database service needs to be started and enabled. This command will restart it after every reboot.

systemctl enable –now mariadb

You interact with MariaDB through SQL. This stands for structured query language. Most databases use this computer language. To start a MariaDB session, go to your terminal:

mariadb –user root

This will start a session and allow you to enter SQL commands. To see what databases you have on your system type:

Show databases;

You will see whatever is installed on your system. Let us put something there. To create a database we type:

Create database pokemon;

Let us see our list of databases again.

show databases;

Now, let us switch to this database so our commands affect it.

use pokemon;

You will notice the pokemon database is listed at your prompt now. That tells you what database you are using. To query data, we need to work with tables. To see what tables we have, let us ask. Run the following command in your terminal.

show tables;

A table is two dimensional. It has rows and columns.  It is likely that nothing shows up since we just created this database. However, this is how you would see the data if you were active in another database.

We do not have any tables, so let us create one.

create table name(data_name varchar(20));

The next step is to create a column that can hold data. Let us do this now:

alter table name add name varchar(20);

We can look at the columns.

show columns from name;

Now, we have a table and should give you an idea how to keep going.

### Conclusion

We talked about how to install and interact with MariaDB. Then we enabled our database service and got it started. Afterwards, we took a look at how to start querying data that resides in your database. Next, I will show you how to create tables and your own data. This will let you use the previous techniques to look at your data.