Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

How to Download and Install MariaDB on CentOS 7 Linux

October 25, 2022
in Blog, Linux
0
ADVERTISEMENT

Table of Contents

MariaDB server 5.5

MariaDB Server is available and supported on RHEL 7 and CentOS 7 and is easily deployed from OS vendor repositories or MariaDB repositories using yum.

The RHEL 7 and CentOS 7 distributions include MariaDB Server 5.5 by default. You can install MariaDB Server using this command: sudo yum install mariadb-server

# mysql -u root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 5.5.68-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Add MariaDB YUM repository

1. To deploy MariaDB Server 10.x and later on RHEL 7 or CentOS 7, first download and use the mariadb_repo_setup script to configure the MariaDB repositories for yum:

sudo yum -y update
curl -LsS -O https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
sudo bash mariadb_repo_setup --mariadb-server-version=10.8

List all available repositories on the system

sudo yum clean all
sudo yum repolist | grep mariadb
# sudo yum clean all
# sudo yum repolist | grep mariadb
mariadb-main                        MariaDB Server                           131
mariadb-maxscale                    MariaDB MaxScale                           4
mariadb-tools                       MariaDB Tools                             16

Install MariaDB 10.x on CentOS 7

MariaDB 10.x packages are available on the repo we just added. Let’s install server and client packages.

sudo yum install MariaDB-server MariaDB-client MariaDB-backup -y
With the command package details can be queried
rpm -qi MariaDB-server
[root@centos7 tmp]# rpm -qi MariaDB-server
Name        : MariaDB-server
Version     : 10.8.5
Release     : 1.el7.centos
Architecture: x86_64
Install Date: Tue 25 Oct 2022 08:29:54 AM UTC
Group       : Applications/Databases
Size        : 129526813
License     : GPLv2
Signature   : DSA/SHA1, Fri 16 Sep 2022 05:21:14 AM UTC, Key ID cbcb082a1bb943db
Source RPM  : MariaDB-server-10.9.3-1.el7.centos.src.rpm
Build Date  : Tue 13 Sep 2022 09:21:04 PM UTC
Build Host  : centos74-amd64
Relocations : (not relocatable)
Vendor      : MariaDB Foundation
URL         : http://mariadb.org
ADVERTISEMENT

Configure MariaDB 10.x on CentOS 7

1. Start and enable the mariadb database service on boot.

systemctl enable mariadb && systemctl start mariadb && systemctl status mariadb
# systemctl enable mariadb && systemctl start mariadb && systemctl status mariadb
Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.
● mariadb.service - MariaDB 10.8.5 database server
   Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/mariadb.service.d
           └─migrated-from-my.cnf-settings.conf
   Active: active (running) since Tue 2022-10-25 06:15:20 EDT; 7ms ago
     Docs: man:mariadbd(8)
           https://mariadb.com/kb/en/library/systemd/
2. Client version checking with command:
# mariadb -V
mariadb  Ver 15.1 Distrib 10.8.5-MariaDB, for Linux (x86_64) using readline 5.1

3. Use the mariadb-secure-installation script to secure your MariaDB database server

sudo mariadb-secure-installation
# sudo mariadb-secure-installation

You already have your root account protected, so you can safely answer 'n'.

Change the 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 '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!

4. Access to MariaDB shell using the password that you’ve created in the previous step.

# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 13
Server version: 10.8.5-MariaDB MariaDB Server

MariaDB [(none)]> SELECT VERSION ();
+----------------+
| VERSION ()     |
+----------------+
| 10.8.5-MariaDB |
+----------------+
1 row in set (0.000 sec)

5. Create a test database/user in MariaDB in Centos 7.

MariaDB [(none)]> CREATE DATABASE mydb;
Query OK, 1 row affected (0.001 sec)

MariaDB [(none)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mydb               |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.001 sec)
ADVERTISEMENT
5/5 - (1 vote)
Previous Post

Enable Free Let’s Encrypt SSL for WordPress with Nginx on CentOS

Next Post

How to Download and Install PHP 7.4 on Ubuntu 20.04 LTS

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory