Installing MariaDB with YUM:
1. Adding the MariaDB YUM repository
2. Installing MariaDB with YUM
3. start MariaDB
[root@localhost hen]# systemctl start mariadb
[root@localhost hen]# mysql
================
1. Adding the MariaDB YUM repository
[root@localhost hen]# vi /etc/yum.repos.d/MariaDB.repo
[root@localhost hen]# cat /etc/yum.repos.d/MariaDB.repo
# MariaDB 10.2 CentOS repository list - created 2017-09-06 03:11 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.2/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
================
2. Installing MariaDB with YUM
[root@localhost hen]# yum install MariaDB-server MariaDB-client
Loaded plugins: fastestmirror, langpacks
base | 3.6 kB 00:00
epel/x86_64/metalink | 6.4 kB 00:00
epel | 4.3 kB 00:00
extras | 3.4 kB 00:00
mariadb | 2.9 kB 00:00
mongodb-org-3.4 | 2.5 kB 00:00
updates | 3.4 kB 00:00
(1/5): epel/x86_64/group_gz | 170 kB 00:00
(2/5): epel/x86_64/updateinfo | 817 kB 00:00
(3/5): extras/primary_db | 191 kB 00:00
(4/5): mariadb/primary_db | 21 kB 00:00
(5/5): epel/x86_64/primary_db | 4.8 MB 00:00
Loading mirror speeds from cached hostfile
* epel: mirror2.totbb.net
Resolving Dependencies
--> Running transaction check
---> Package MariaDB-client.x86_64 0:10.2.8-1.el7.centos will be installed
--> Processing Dependency: MariaDB-common for package: MariaDB-client-10.2.8-1.el7.centos.x86_64
---> Package MariaDB-server.x86_64 0:10.2.8-1.el7.centos will be installed
--> Processing Dependency: galera for package: MariaDB-server-10.2.8-1.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-common.x86_64 0:10.2.8-1.el7.centos will be installed
--> Processing Dependency: MariaDB-compat for package: MariaDB-common-10.2.8-1.el7.centos.x86_64
---> Package galera.x86_64 0:25.3.20-1.rhel7.el7.centos will be installed
--> Processing Dependency: libboost_program_options.so.1.53.0()(64bit) for package: galera-25.3.20-1.rhel7.el7.centos.x86_64
--> Running transaction check
---> Package MariaDB-compat.x86_64 0:10.2.8-1.el7.centos will be obsoleting
---> Package boost-program-options.x86_64 0:1.53.0-26.el7 will be installed
---> Package mariadb-libs.x86_64 1:5.5.52-1.el7 will be obsoleted
--> Finished Dependency Resolution
Dependencies Resolved
================================================================================
Package Arch Version Repository
Size
================================================================================
Installing:
MariaDB-client x86_64 10.2.8-1.el7.centos mariadb 48 M
MariaDB-compat x86_64 10.2.8-1.el7.centos mariadb 2.8 M
replacing mariadb-libs.x86_64 1:5.5.52-1.el7
MariaDB-server x86_64 10.2.8-1.el7.centos mariadb 108 M
Installing for dependencies:
MariaDB-common x86_64 10.2.8-1.el7.centos mariadb 155 k
boost-program-options x86_64 1.53.0-26.el7 base 156 k
galera x86_64 25.3.20-1.rhel7.el7.centos mariadb 8.0 M
Transaction Summary
================================================================================
Install 3 Packages (+3 Dependent packages)
Total download size: 168 M
Is this ok [y/d/N]:
Is this ok [y/d/N]: y
Downloading packages:
警告:/var/cache/yum/x86_64/7/mariadb/packages/MariaDB-10.2.8-centos7-x86_64-com mon.rpm: 表頭 V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
Public key for MariaDB-10.2.8-centos7-x86_64-common.rpm is not installed
(1/6): MariaDB-10.2.8-centos7-x86_64-common.rpm | 155 kB 00:01
(2/6): MariaDB-10.2.8-centos7-x86_64-compat.rpm | 2.8 MB 00:11
(3/6): boost-program-options-1.53.0-26.el7.x86_64.rpm | 156 kB 00:00
(4/6): MariaDB-10.2.8-centos7-x86_64-client.rpm | 48 MB 00:03:16
(5/6): galera-25.3.20-1.rhel7.el7.centos.x86_64.rpm | 8.0 MB 00:00:34
(6/6): MariaDB-10.2.8-centos7-x86_64-server.rpm | 108 MB 00:07:29
------------------------------------------------------------------------------------
Total 371 kB/s | 168 MB 07:42
Retrieving key from https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Importing GPG key 0x1BB943DB:
Userid : "MariaDB Package Signing Key <package-signing-key@mariadb.org>"
Fingerprint: 1993 69e5 404b d5fc 7d2f e43b cbcb 082a 1bb9 43db
From : https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
Is this ok [y/N]:
Is this ok [y/N]: y
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : MariaDB-common-10.2.8-1.el7.centos.x86_64 1/7
Installing : MariaDB-compat-10.2.8-1.el7.centos.x86_64 2/7
Installing : MariaDB-client-10.2.8-1.el7.centos.x86_64 3/7
Installing : boost-program-options-1.53.0-26.el7.x86_64 4/7
Installing : galera-25.3.20-1.rhel7.el7.centos.x86_64 5/7
Installing : MariaDB-server-10.2.8-1.el7.centos.x86_64 6/7
chown: 無效的使用者: ‘mysql’
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
'/usr/bin/mysqladmin' -u root password 'new-password'
'/usr/bin/mysqladmin' -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
'/usr/bin/mysql_secure_installation'
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.
Please report any problems at http://mariadb.org/jira
The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/
Erasing : 1:mariadb-libs-5.5.52-1.el7.x86_64 7/7
Verifying : MariaDB-compat-10.2.8-1.el7.centos.x86_64 1/7
Verifying : MariaDB-client-10.2.8-1.el7.centos.x86_64 2/7
Verifying : boost-program-options-1.53.0-26.el7.x86_64 3/7
Verifying : galera-25.3.20-1.rhel7.el7.centos.x86_64 4/7
Verifying : MariaDB-server-10.2.8-1.el7.centos.x86_64 5/7
Verifying : MariaDB-common-10.2.8-1.el7.centos.x86_64 6/7
Verifying : 1:mariadb-libs-5.5.52-1.el7.x86_64 7/7
Installed:
MariaDB-client.x86_64 0:10.2.8-1.el7.centos
MariaDB-compat.x86_64 0:10.2.8-1.el7.centos
MariaDB-server.x86_64 0:10.2.8-1.el7.centos
Dependency Installed:
MariaDB-common.x86_64 0:10.2.8-1.el7.centos
boost-program-options.x86_64 0:1.53.0-26.el7
galera.x86_64 0:25.3.20-1.rhel7.el7.centos
Replaced:
mariadb-libs.x86_64 1:5.5.52-1.el7
Complete!
================
3. start MariaDB
systemctl start mariadb
[root@localhost hen]# systemctl start mariadb
[root@localhost hen]# mysql
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.2.8-MariaDB MariaDB Server
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
MariaDB [(none)]> use test
Database changed
MariaDB [test]> SHOW TABLES;
Empty set (0.00 sec)
MariaDB [test]>