在CentOS 6上通过软件集合(SCL)安装MariaDB 10.2
首先
使用软件集合(SCL)在CentOS6上安装MariaDB 10.2。
原文链接:MySQL,MariaDB的各种安装方法和EOL总结 – Qiita
参考链接:快速入门 – 软件集合
支持
如果采用本方法进行引入,根据红帽软件集产品生命周期 – 红帽客户门户网站,2020年10月被认为是EOL。
在此之后,可能不会实施针对报告的漏洞或问题的解决措施。
日志
注册资料库
# yum install -y centos-release-scl
安装
# cat /etc/redhat-release
CentOS release 6.10 (Final)
# yum install -y rh-mariadb102
# scl enable rh-mariadb102 bash
... 略
启动/停止MySQL
在第一次启动时,会显示有关初始设置的相关消息。
# service rh-mariadb102-mariadb start
Initializing MariaDB database
PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:
scl enable rh-mariadb102 -- '/opt/rh/rh-mariadb102/root/usr/libexec/mysqladmin' -u root password 'new-password'
scl enable rh-mariadb102 -- '/opt/rh/rh-mariadb102/root/usr/libexec/mysqladmin' -u root -h 480e4a04dbf1 password 'new-password'
Alternatively you can run:
scl enable rh-mariadb102 -- '/opt/rh/rh-mariadb102/root/usr/libexec/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:
Get Involved
Starting rh-mariadb102-mariadb: [ OK ]
# service rh-mariadb102-mariadb status
rh-mariadb102-mariadb (pid 486) is running...
# service rh-mariadb102-mariadb stop
Stopping rh-mariadb102-mariadb: [ OK ]
# service rh-mariadb102-mariadb status
rh-mariadb102-mariadb is stopped
自动启动/取消MySQL配置。
# chkconfig rh-mariadb102-mariadb on
# chkconfig --list rh-mariadb102-mariadb
rh-mariadb102-mariadb 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# chkconfig rh-mariadb102-mariadb off
# chkconfig --list rh-mariadb102-mariadb
rh-mariadb102-mariadb 0:off 1:off 2:off 3:off 4:off 5:off 6:off
各种确认 (gè
# service rh-mariadb102-mariadb start
Database MariaDB is probably initialized in /var/opt/rh/rh-mariadb102/lib/mysql already, nothing is done.
If this is not the case, make sure the /var/opt/rh/rh-mariadb102/lib/mysql is empty before running mysql-prepare-db-dir.
Starting rh-mariadb102-mariadb: [ OK ]
# mysql -u root -e'select version();'
+-----------------+
| version() |
+-----------------+
| 10.2.22-MariaDB |
+-----------------+