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
Step 2
Now, to consult detailed information of MariaDB we execute the following:
yum info mariadb
Step 3
We proceed with the installation of MariaDB by running:
yum install mariadb-server
Step 4
Enter the letter "s" to confirm the download and installation of MariaDB:
Step 5
We proceed to enable the MariaDB service by running the following line:
systemctl enable mariadb.service
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
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:
Step 3
There he asks if we want to assign one, we enter the letter “Y†to assign the MariaDB root user password:
Step 4
After this we find a series of questions such as:
- Delete the anonymous user.
- Delete the test database.
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:
Step 2
There we can enter the command “show databases;†to visualize the available databases and leave MariaDB by executing “quitâ€:
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)
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:
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.