目前最新的稳定版mariadb为10.4.11,下载对应的安装包及依赖包(可到我的百度网盘下载)
boost-program-options-1.53.0-27.el7.x86_64.rpm
galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm
MariaDB-client-10.4.11-1.el7.centos.x86_64.rpm
MariaDB-common-10.4.11-1.el7.centos.x86_64.rpm
MariaDB-compat-10.4.11-1.el7.centos.x86_64.rpm
MariaDB-server-10.4.11-1.el7.centos.x86_64.rpm
perl-Compress-Raw-Bzip2-2.061-3.el7.x86_64.rpm
perl-Compress-Raw-Zlib-2.061-4.el7.x86_64.rpm
perl-Data-Dumper-2.145-3.el7.x86_64.rpm
perl-DBI-1.627-4.el7.x86_64.rpm
perl-IO-Compress-2.061-2.el7.noarch.rpm
perl-Net-Daemon-0.48-5.el7.noarch.rpm
perl-PlRPC-0.2020-14.el7.noarch.rpm
查看是否安装了老版本的mysql
rpm -qa|grep mariadb-libs
如果存在,请先卸载
rpm -e mariadb-libs-5.5.64-1.el7.x86_64 --nodeps
将RPM包上传至centos服务器,CD到RPM包所在路径执行安装
yum localinstall *.rpm -y
启动mariadb服务
systemctl start mariadb
设置root帐号密码
mysqladmin -u root password 123456
登录数据库,开启远程访问权限
mysql -uroot -p123456
grant all privileges on *.* to ‘root‘@‘%‘ identified by ‘123456‘ with grant option;
flush privileges;
exit
设置mariadb开机启动
systemctl list-unit-files | grep mariadb
systemctl enable mariadb
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
完成,睡觉!