+4 votes
207 views
How to install MariaDB on CentOS 8

in Linux / Unix by (551k points)
reopened | 207 views

1 Answer

+5 votes
Best answer

1. How to install MariaDB on CentOS 8
2. How to secure the MariaDB server in CentOS 8
3. How to access MariaDB in CentOS 8
4. How to add databases in MariaDB in CentOS 8

The databases are currently one of the most used components by thousands of developers, support staff and IT user for a centralized and secure control of the organization's data. Hence the importance of having the key tools for proper administration . Next in TechnoWikis we will talk about one of the most used tools for this task such as MariaDB and this process will be done in the new CentOS 8 edition..

What is MariaDB
MariaDB Server is listed as one of the most used database servers in the world for its various functions, security, scalability and dynamism in data control and one of its biggest advantages is that it has been built by developers MySQL originals so it is an open source utility constantly updated.

MariaDB is able to convert data into structured information compatible with a wide range of current applications and makes use of a relational database which integrates an SQL interface for data access. As a point in favor of MariaDB we tell you that the latest versions of MariaDB include GIS and JSON functions.

Limitations versions of MariaDB
MariaDB versions act as a replacement for MySQL, but it has some limitations such as:
  • MariaDB data files are usually binary compatible with the equivalent version of MySQL.
  • All file and path names are the same.
  • Data and table definition (.frm) files are fully compatible with binaries.
highlights
Some of its most outstanding features are:
  • MariaDB is compatible with multiple operating systems such as Linux, FreeBSD, macOS and some more.
  • It has support for the PHP language.
  • MariaDB makes use of standard query languages.
  • Integrates dynamic columns such as COLUMN_ADD, COLUMN_CHECK, COLUMN_CREATE, COLUMN_DELETE, COLUMN_EXISTS, COLUMN_GET, COLUMN_JSON, COLUMN_LIST
  • Integrates Galera cluster technology.
  • Now let's see how to install MariaDB on CentOS 8.

1. How to install MariaDB on CentOS 8

Step 1

The first step to take will be to consulate MariaDB packages in CentOS 8 by executing the following:
 yum search mariadb 
image
Step 2

Now, to consult detailed information of MariaDB we execute the following:
 yum info mariadb 
image
Step 3

We proceed with the installation of MariaDB by running:
 yum install mariadb-server 
image
Step 4

Enter the letter "s" to confirm the download and installation of MariaDB: image
Step 5

We proceed to enable the MariaDB service by running the following line:
 systemctl enable mariadb.service 
image
Step 6

Some of the useful commands to manage MariaDB are:
Stop the MariaDB service
 systemctl stop mariadb.service 

Start the MariaDB service
 systemctl start mariadb.service 

Restart the MariaDB service
 systemctl restart mariadb.service 

Check the status of the MariaDB service
 systemctl status mariadb.service 
image

2. How to secure the MariaDB server in CentOS 8

Step 1

Now it is time to protect the MariaDB server in CentOS 8, for this we will execute the following:
 mysql_secure_installation 
Step 2

First, it will be indicated that we enter the password of the root user, as it has not been assigned we must press Enter: image
Step 3

There he asks if we want to assign one, we enter the letter “Y” to assign the MariaDB root user password: image
Step 4

After this we find a series of questions such as:
  • Delete the anonymous user.
  • Disable remote access.
  • Delete the test database.
  • Reload privileges.
image

3. How to access MariaDB in CentOS 8

Step 1

To access MariaDB in CentOS 8 we must enter the following command:
 mysql -u root -p 
Press Enter and enter the password that we have entered in the configuration process and thus access MariaDB: image
Step 2

There we can enter the command “show databases;” to visualize the available databases and leave MariaDB by executing “quit”: image

4. How to add databases in MariaDB in CentOS 8

Step 1

The first place will be to access MySQL by running:
 mysql -u root -p mysql 
Once we access MariaDB we create our database as follows:
 CREATE DATABASE solvetic; (create a new database) CREATE USER 'solvetic' @ 'localhost' IDENTIFIED BY 'solvetic'; (Create the user next to the user's password) GRANT ALL ON solvetic1. * TO 'solvetic' @ 'localhost'; (Grant permissions of the database to the user) FLUSH PRIVILEGES; (Restart privileges) 
image

We left MariaDB running "quit"..

Step 2

After this we can run again "show databases;" and there we will see the database created:
To enter MariaDB with the database created, we will execute the following in CentOS 8:
 mysql -u solvetic -p'solvetic 'solvetic1 
Or we can execute:
 mysql -u solvetic -p solvetic1 
Then we enter the password.
Step 3

The result will be access to said database: image

It's that simple we have installed and created databases in MariaDB in CentOS 8 and we already have the best solutions to manage databases.


by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Oct 8, 2020 in Linux / Unix by backtothefuture (551k points) | 347 views
+5 votes
1 answer
asked Sep 2, 2020 in Linux / Unix by backtothefuture (551k points) | 2k views
+3 votes
1 answer
asked Aug 13, 2020 in Linux / Unix by backtothefuture (551k points) | 1.9k views
+4 votes
1 answer
asked Jun 9, 2020 in Linux / Unix by backtothefuture (551k points) | 603 views
+4 votes
1 answer
asked May 14, 2020 in Linux / Unix by backtothefuture (551k points) | 613 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,643 questions
10,775 answers
510 comments
3 users