MariaDB介绍
MariaDB服务器是世界上最流行的数据库服务器之一。它由MySQL的原始开发人员制作,并保证保持开源。MariaDB在网站的各种应用程序中将数据转换为结构化信息。MariaDB最初是作为MySQL的增强型即插即用替代品而设计的,它速度快、可扩展且健壮,具有丰富的存储引擎、插件和许多其他工具生态系统,使其非常适合各种各样的使用情况。MariaDB是作为开源软件开发的,作为关系数据库,它提供了访问数据的SQL接口,MariaDB的最新版本还包括GIS和JSON功能。
MariaDB是MySQL的一个社区开发分支,它是一个多用户、多线程的SQL数据库服务器。它是一个客户端/服务器实现,包括一个服务器守护程序(mysqld)和许多不同的客户端程序和库。基本包包含标准的MariaDB/MySQL客户端程序和通用MySQL文件
查看仓库信息
运行dnf info mariadb查看,系统软件仓库中已经存在
Available Packages
Name : mariadb
Epoch : 3
Version : 10.5.13
Release : 1.al8
Architecture : x86_64
Size : 6.2 M
Source : mariadb-10.5.13-1.al8.src.rpm
Repository : alinux3-updates
Summary : A very fast and robust SQL database server
URL : http://mariadb.org
License : GPLv2 with exceptions and LGPLv2 and BSD
Description : MariaDB is a community developed branch of MySQL - a multi-user, multi-threaded
: SQL database server. It is a client/server implementation consisting of
: a server daemon (mysqld) and many different client programs and libraries.
: The base package contains the standard MariaDB/MySQL client programs and
: generic MySQL files.
安装
运行dnf install mariadb-server安装服务端
===================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================
Installing:
mariadb-server x86_64 3:10.5.13-1.al8 alinux3-updates 18 M
Installing dependencies:
checkpolicy x86_64 2.9-1.2.al8 alinux3-os 348 k
libaio x86_64 0.3.112-1.2.al8 alinux3-os 33 k
mariadb-errmsg x86_64 3:10.5.13-1.al8 alinux3-updates 240 k
mysql-selinux noarch 1.0.2-4.1.al8 alinux3-updates 37 k
policycoreutils-python-utils noarch 2.9-14.1.al8 alinux3-updates 252 k
python3-audit x86_64 3.0-0.17.20191104git1c2f876.1.al8 alinux3-os 86 k
python3-libsemanage x86_64 2.9-6.1.al8 alinux3-updates 127 k
python3-policycoreutils noarch 2.9-14.1.al8 alinux3-updates 2.2 M
python3-setools x86_64 4.3.0-2.1.al8 alinux3-os 650 k
Transaction Summary
===================================================================================================================================================================
Install 10 Packages
Total download size: 22 M
Installed size: 105 M
Is this ok [y/N]: y
Downloading Packages:
(1/10): mysql-selinux-1.0.2-4.1.al8.noarch.rpm 372 kB/s | 37 kB 00:00
(2/10): policycoreutils-python-utils-2.9-14.1.al8.noarch.rpm 15 MB/s | 252 kB 00:00
(3/10): python3-libsemanage-2.9-6.1.al8.x86_64.rpm 16 MB/s | 127 kB 00:00
(4/10): mariadb-errmsg-10.5.13-1.al8.x86_64.rpm 1.4 MB/s | 240 kB 00:00
(5/10): python3-policycoreutils-2.9-14.1.al8.noarch.rpm 35 MB/s | 2.2 MB 00:00
(6/10): checkpolicy-2.9-1.2.al8.x86_64.rpm 12 MB/s | 348 kB 00:00
(7/10): python3-audit-3.0-0.17.20191104git1c2f876.1.al8.x86_64.rpm 5.9 MB/s | 86 kB 00:00
(8/10): python3-setools-4.3.0-2.1.al8.x86_64.rpm 22 MB/s | 650 kB 00:00
(9/10): libaio-0.3.112-1.2.al8.x86_64.rpm 335 kB/s | 33 kB 00:00
(10/10): mariadb-server-10.5.13-1.al8.x86_64.rpm 40 MB/s | 18 MB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 48 MB/s | 22 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : python3-setools-4.3.0-2.1.al8.x86_64 1/10
Installing : python3-audit-3.0-0.17.20191104git1c2f876.1.al8.x86_64 2/10
Installing : libaio-0.3.112-1.2.al8.x86_64 3/10
Installing : checkpolicy-2.9-1.2.al8.x86_64 4/10
Installing : python3-libsemanage-2.9-6.1.al8.x86_64 5/10
Installing : python3-policycoreutils-2.9-14.1.al8.noarch 6/10
Installing : policycoreutils-python-utils-2.9-14.1.al8.noarch 7/10
Running scriptlet: mysql-selinux-1.0.2-4.1.al8.noarch 8/10
Installing : mysql-selinux-1.0.2-4.1.al8.noarch 8/10
Running scriptlet: mysql-selinux-1.0.2-4.1.al8.noarch 8/10
libsemanage.semanage_direct_install_info: Overriding mysql module at lower priority 100 with module at priority 200.
Installing : mariadb-errmsg-3:10.5.13-1.al8.x86_64 9/10
Running scriptlet: mariadb-server-3:10.5.13-1.al8.x86_64 10/10
Installing : mariadb-server-3:10.5.13-1.al8.x86_64 10/10
Running scriptlet: mariadb-server-3:10.5.13-1.al8.x86_64 10/10
Running scriptlet: mysql-selinux-1.0.2-4.1.al8.noarch 10/10
Running scriptlet: mariadb-server-3:10.5.13-1.al8.x86_64 10/10
Verifying : mariadb-errmsg-3:10.5.13-1.al8.x86_64 1/10
Verifying : mariadb-server-3:10.5.13-1.al8.x86_64 2/10
Verifying : mysql-selinux-1.0.2-4.1.al8.noarch 3/10
Verifying : policycoreutils-python-utils-2.9-14.1.al8.noarch 4/10
Verifying : python3-libsemanage-2.9-6.1.al8.x86_64 5/10
Verifying : python3-policycoreutils-2.9-14.1.al8.noarch 6/10
Verifying : checkpolicy-2.9-1.2.al8.x86_64 7/10
Verifying : libaio-0.3.112-1.2.al8.x86_64 8/10
Verifying : python3-audit-3.0-0.17.20191104git1c2f876.1.al8.x86_64 9/10
Verifying : python3-setools-4.3.0-2.1.al8.x86_64 10/10
Installed:
checkpolicy-2.9-1.2.al8.x86_64 libaio-0.3.112-1.2.al8.x86_64 mariadb-errmsg-3:10.5.13-1.al8.x86_64
mariadb-server-3:10.5.13-1.al8.x86_64 mysql-selinux-1.0.2-4.1.al8.noarch policycoreutils-python-utils-2.9-14.1.al8.noarch
python3-audit-3.0-0.17.20191104git1c2f876.1.al8.x86_64 python3-libsemanage-2.9-6.1.al8.x86_64 python3-policycoreutils-2.9-14.1.al8.noarch
python3-setools-4.3.0-2.1.al8.x86_64
Complete!
运行dnf install mariadb安装客户端
===================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================
Installing:
mariadb x86_64 3:10.5.13-1.al8 alinux3-updates 6.2 M
Installing dependencies:
mariadb-common x86_64 3:10.5.13-1.al8 alinux3-updates 68 k
mariadb-connector-c x86_64 3.1.11-2.1.al8 alinux3-updates 200 k
mariadb-connector-c-config noarch 3.1.11-2.1.al8 alinux3-updates 15 k
Transaction Summary
===================================================================================================================================================================
Install 4 Packages
Total download size: 6.5 M
Installed size: 38 M
Is this ok [y/N]: y
Downloading Packages:
(1/4): mariadb-connector-c-3.1.11-2.1.al8.x86_64.rpm 2.0 MB/s | 200 kB 00:00
(2/4): mariadb-common-10.5.13-1.al8.x86_64.rpm 554 kB/s | 68 kB 00:00
(3/4): mariadb-connector-c-config-3.1.11-2.1.al8.noarch.rpm 182 kB/s | 15 kB 00:00
(4/4): mariadb-10.5.13-1.al8.x86_64.rpm 20 MB/s | 6.2 MB 00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 21 MB/s | 6.5 MB 00:00
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : mariadb-connector-c-config-3.1.11-2.1.al8.noarch 1/4
Installing : mariadb-common-3:10.5.13-1.al8.x86_64 2/4
Installing : mariadb-connector-c-3.1.11-2.1.al8.x86_64 3/4
Installing : mariadb-3:10.5.13-1.al8.x86_64 4/4
Running scriptlet: mariadb-3:10.5.13-1.al8.x86_64 4/4
Verifying : mariadb-3:10.5.13-1.al8.x86_64 1/4
Verifying : mariadb-common-3:10.5.13-1.al8.x86_64 2/4
Verifying : mariadb-connector-c-3.1.11-2.1.al8.x86_64 3/4
Verifying : mariadb-connector-c-config-3.1.11-2.1.al8.noarch 4/4
Installed:
mariadb-3:10.5.13-1.al8.x86_64 mariadb-common-3:10.5.13-1.al8.x86_64 mariadb-connector-c-3.1.11-2.1.al8.x86_64 mariadb-connector-c-config-3.1.11-2.1.al8.noarch
Complete!
查看系统服务信息, mysqld和mariadb相同
[root@iZ2ze4v0qmpn8c4laatw8qZ ~]# systemctl status mysqld
● mariadb.service - MariaDB 10.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
[root@iZ2ze4v0qmpn8c4laatw8qZ ~]# systemctl status mariadb
● mariadb.service - MariaDB 10.5 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:mysqld(8)
https://mariadb.com/kb/en/library/systemd/
启动
systemctl start mariadb启动服务,用mysql客户端即可连接
[root@iZ2ze4v0qmpn8c4laatw8qZ ~]# systemctl start mariadb
[root@iZ2ze4v0qmpn8c4laatw8qZ ~]# mysql -uroot
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 3
Server version: 10.5.13-MariaDB MariaDB Server
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
+--------------------+
3 rows in set (0.001 sec)
MariaDB [(none)]>