Get the App
SLTechnology News&Howtos  ›  Development  › 

How to configure MariaDB quickly under CentOS7

Shulou Source: shulou.com Published: 2022-06-01 16:38:15 10月25日 Update

This article mainly explains "how to configure MariaDB quickly under CentOS7". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to quickly configure MariaDB under CentOS7.

MariaDB database management system is a branch of MySQL and is mainly maintained by the open source community. The purpose of licensing MariaDB with GPL is to be fully compatible with MySQL, including API and the command line, making it an easy replacement for MySQL.

Step 1: add a MariaDB yum repository

1. First, add the YUM configuration file MariaDB.repo file of MariaDB to RHEL/CentOS and Fedora operating systems.

# vi / etc/yum.repos.d/MariaDB.repo

Depending on your operating system version, select the appropriate content below to add to the end of the file.

Install in CentOS 7

[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/centos7-amd64 gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1

Install in RHEL 7

[mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.1/rhel7-amd64 gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1

Add MariaDB YUM Warehouse

Step 2: install MariaDB in CentOS 7

2. When the MariaDB warehouse address is added, you can easily install MariaDB with the following command.

# yum install MariaDB-server MariaDB-client-y

Install MariaDB in CentOS 7

3. After the MariaDB package is installed, start the database service daemon immediately, and you can use the following operation settings to start the service automatically after the operating system restarts.

# systemctl start mariadb # systemctl enable mariadb # systemctl status mariadb

Start the MariaDB service in CentOS 7

Step 3: security configuration of MariaDB in CentOS 7

4. Now you can configure the security by setting the root account password for MariaDB, disabling root remote login, deleting the test database and the test account, and finally reloading the permissions using the following command.

# mysql_secure_installation

MySQL Security configuration in CentOS 7

5. After configuring the security configuration of the database, you may want to check the features of MariaDB, such as version number, default parameter list, and login through the MariaDB command line. As follows:

# mysql-V # mysqld-- print-defaults # mysql-u root-p

Check MySQL version information

At this point, I believe you have a deeper understanding of "how to quickly configure MariaDB under CentOS7". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Tags: Configuration security command data database system faceted Zhongan operating system warehouse content can pass file version service learning check test login practical Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Docker Linux Shulou Information Shulou Technology