MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可 MariaDB的目的是完全兼容MySQL,包括API和命令行,使之能轻松成为MySQL的代替品。
CentOS 7.6安装MariaDB10.4.8
- 依次下载好安装包和依赖
[root@localhost software]# cd MariaDB-10.4.8.stable-CentOS7.x/
[root@localhost MariaDB-10.4.8.stable-CentOS7.x]# pwd
/home/software/MariaDB-10.4.8.stable-CentOS7.x
[root@localhost MariaDB-10.4.8.stable-CentOS7.x]# ls
galera-4-26.4.2-1.rhel7.el7.centos.x86_64.rpm MariaDB-client-10.4.8-1.el7.centos.x86_64.rpm
jemalloc-3.6.0-1.el7.x86_64.rpm MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm
jemalloc-devel-3.6.0-1.el7.x86_64.rpm MariaDB-compat-10.4.8-1.el7.centos.x86_64.rpm
libaio-0.3.107-10.el6.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
- 按顺序安装依赖环境
yum install rsync nmap lsof perl-DBI nc
rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
- 卸载冲突的库
rpm -qa | grep mariadb-libs
rpm -ev --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
rpm -qa | grep mariadb-libs
- 安装bost-devel依赖
yum install boost-devel.x86_64
- 导入MariaDB的key
rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB
- 安装galera环境
rpm -ivh galera-4-26.4.2-1.rhel7.el7.centos.x86_64.rpm
- 安装libaio
wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm
- 安装核心包
rpm -ivh MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm MariaDB-compat-10.4.8-1.el7.centos.x86_64.rpm MariaDB-client-10.4.8-1.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
- 重启MySQL服务
service mysql start
- 服务启动成功后,进行安全配置
mysql_secure_installation
1. 输入当前密码,初次安装后是没有密码的,直接回车
2.询问是否使用`unix_socket`进行身份验证:n
3.为root设置密码:y
4.输入root的新密码:root
5.确认输入root的新密码:root
6.是否移除匿名用户,这个随意,建议删除:y
7.拒绝用户远程登录,这个建议开启:n
8.删除test库,可以保留:n
9.重新加载权限表:y
- 设置远程连接(进入控制台设置)
grant all privileges on *.* to 'root'@'%' identified by 'root密码';
flush privileges;
参考文档
https://mariadb.com/kb/en/mariadb-installation-version-10121-via-rpms-on-centos-7/