Do you want to know how to install MariaDB 10.4 centos 7? Follow the below steps. This guide will help you to get install it without any err.
Before dig into the steps let us know little about MariaDB
What is MariaDB?
MariaDB is a popular database server that is used as open-source software. It has a General Public License so it is free to access.
Contents
Steps to Install MariaDB 10.4 :
Step 1: Update your System
Make sure you are running the updated CentOS 7 server. If not Update your system. The command we follow.
sudo yum -y update
Step 2: Add MariaDB 10.4 repository
Create a new repository on your computer and add the code below according to your OS and configuration.
sudo file /etc/yum.repos.d/MariaDB.repo<<EO
F
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.4/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
EOF
Note: You can update the yum cache index point.
Use the command: sudo yum makecache fast
Step 3: Install MariaDB 10.4 server
Use the following command to install MariaDB 10.4.
sudo yum -y install MariaDB-server MariaDB-client
Note: It installs other dependencies with it automatically.
Step 4: Start and Enable service
sudo systemctl enable --now mariadb
Optional Step: View the installed MariaDB properties
Use the below command to view the MariaDB properties.
$ rpm -qi MariaDB-server
Shows the property as like
Name : MariaDB-server
Version : 10.4.6
Release : 1.el7.centos
Architecture: x86_64
Install Date: Fri 03 Jan 2019 06:31:57 AM ESTf
Group : Applications/Databases
Size : 130648787
License : GPLv2
Signature : DSA/SHA1, Tue 18 Jun 2019 08:13:58 PM CEST, Key ID cbcb082a1bb943db
Source RPM : MariaDB-server-10.4.6-1.el7.centos.src.rpm
Build Date : Tue 24 Dec 2019 03:57:58 AM CEST
Build Host : centos73-amd64
Relocations : (not relocatable)
Vendor : MariaDB Foundation
URL : http://mariadb.org
Summary : MariaDB: a super fast and robust SQL database server
Description :
Step 5: Secure MariaDB Install
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
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on…
Setting the root password ensures that nobody can log into the MariaDB root user without the proper authorization.
Set root password? [Y/n] y
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
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 the '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 the 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!
You did it man. Installation is done now. Do you want to connect to the MariaDB server? Follow the below command.
$ mysql -u root -p
Final Words:
Now you can play around the Database by creating Tables, User, etc.
If you have anything to ask, leave your query below
Leave a Reply