安装方式

  • 在线安装(慢的要命)
  • RPM离线安装(CentOS7.X)

在线安装

  1. 打开官方网站 https://mariadb.org/

  2. 点击Download,跳转到下一页面

  3. 继续点击Download,进到下页

  4. 点击红框中的[链接] (https://downloads.mariadb.org/mariadb/repositories/#mirror=23Media),进到一下页面

  5. 根据自己的服务器的类型/版本来选择要安装的数据库版本.

    按照上述步骤可以在线安装。

离线安装

  1. 点击图4中的baseurl

  2. 点击rpms, 可以看到一堆rpm包,不要着急,继续看下一步

  3. 打开MariaDB org --> Learn --> [MariaDB Knowledge Base] --> MariaDB Server -->

    Getting, Installing, and Upgrading MariaDB --> MariaDB Binary Packages --> Installing MariaDB RPM Files --> MariaDB Installation (Version 10.1.21) via RPMs on CentOS 7

    最终的url点击之后,就可以看到如下图所示界面:



    本来完全可以提供最终的一个url,提供一步一步点击的按钮连接,是为了方便大家来学习路线思路,而不能只拿结果。

  4. 还记得我们之前第二步看到的一堆rpm包吗? 下载第三步方框中的package,当然,这个文档的版本稍有点落后,但是我们只需要搜索前缀名称就行了,比如搜索client:



    我们下载最新版本就可以了。

    接下来进入正式步骤了哦~:

    在图7中有Step by step installation:

Step by step installation:

    1. First install all of the dependencies needed. Its easy to do this via YUM packages: yum install rsync nmap lsof perl-DBI nc
    1. rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
    1. rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
    1. rpm -ivh MariaDB-10.1.21-centos7-x86_64-common.rpm MariaDB-10.1.21-centos7-x86_64-compat.rpm MariaDB-10.1.21-centos7-x86_64-client.rpm galera-25.3.19-1.rhel7.el7.centos.x86_64.rpm MariaDB-10.1.21-centos7-x86_64-server.rpm

按照步骤我们开始:

  1. 安装依赖信息,命令行执行:

    [root@iZ2ze7s2v0b78922wia32rZ software]#  yum install rsync nmap lsof perl-DBI nc
  2. 安装我们之前下载的版本jemalloc-3.6.0-1.el7.x86_64.rpm

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh jemalloc-3.6.0-1.el7.x86_64.rpm
  3. 安装jemalloc-devel-3.6.0-1.el7.x86_64.rpm

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh jemalloc-devel-3.6.0-1.el7.x86_64.rpm
  4. 安装剩余的mariadb相关的包,一定要注意顺序.common > compat > client > galera > server

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# 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 galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
    warning: MariaDB-common-10.4.8-1.el7.centos.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
    error: Failed dependencies:
    mariadb-libs < 1:10.1.0 conflicts with MariaDB-compat-10.4.8-1.el7.centos.x86_64
    mariadb-libs is obsoleted by MariaDB-compat-10.4.8-1.el7.centos.x86_64
    libaio.so.1()(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
    libboost_program_options.so.1.53.0()(64bit) is needed by galera-4-26.4.3-1.rhel7.el7.centos.x86_64
    libaio.so.1()(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64

    执行之后发现报错,还是在图7显示页面,我们可以看见Step by step installation: 段落结束之后有这么一句: Here is the error message for dependencies:

    # rpm -ivh MariaDB-10.1.21-centos7-x86_64-common.rpm
    warning: MariaDB-10.1.21-centos7-x86_64-common.rpm: Header V4 DSA/SHA1 Signature, key ID 1bb943db: NOKEY
    error: Failed dependencies:
    mariadb-libs < 1:10.1.21-1.el7.centos conflicts with MariaDB-common-10.1.21-1.el7.centos.x86_64

    是不是和我们的错误很相似?按照官方提供的solution就可以解决了。

    后续还有几个错误,同样按照官方给出的解决方案处理,一步一步就搞定了,如下:

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -qa | grep mariadb-libs
    mariadb-libs-5.5.60-1.el7_5.x86_64
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ev --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
    Preparing packages...
    mariadb-libs-1:5.5.60-1.el7_5.x86_64
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -qa | grep mariadb-libs
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# yum install boost-devel.x86_64
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
    Resolving Dependencies
    --> Running transaction check
    ...
    Is this ok [y/d/N]: y
    ... Complete!
    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm --import http://yum.mariadb.org/RPM-GPG-KEY-MariaDB

    然后重新回到安装的第四步:

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# 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 galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
    error: Failed dependencies:
    libaio.so.1()(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-client-10.4.8-1.el7.centos.x86_64
    libaio.so.1()(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.1)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64
    libaio.so.1(LIBAIO_0.4)(64bit) is needed by MariaDB-server-10.4.8-1.el7.centos.x86_64

    发现还是报错???

    这个是官方在10.4.8中新引入的一个问题,需要下载一个依赖包libaio:

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# wget http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm
    --2019-11-28 10:52:26-- http://mirror.centos.org/centos/6/os/x86_64/Packages/libaio-0.3.107-10.el6.x86_64.rpm

    下载成功之后,安装一下当前下载的依赖包:

    [root@iZ2ze7s2v0b78922wia32rZ mariadb]# rpm -ivh libaio-0.3.107-10.el6.x86_64.rpm

然后再一次重复Step 4:

[root@iZ2ze7s2v0b78922wia32rZ mariadb]# 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 galera-4-26.4.3-1.rhel7.el7.centos.x86_64.rpm MariaDB-server-10.4.8-1.el7.centos.x86_64.rpm
Preparing... ################################# [100%]
Updating / installing...
1:MariaDB-compat-10.4.8-1.el7.cento################################# [ 20%]
2:MariaDB-common-10.4.8-1.el7.cento################################# [ 40%]
3:MariaDB-client-10.4.8-1.el7.cento################################# [ 60%]
4:galera-4-26.4.3-1.rhel7.el7.cento################################# [ 80%]
5:MariaDB-server-10.4.8-1.el7.cento################################# [100%] Two all-privilege accounts were created.
One is root@localhost, it has no password, but you need to
be system 'root' user to connect. Use, for example, sudo mysql
The second is mysql@localhost, it has no password either, but
you need to be the system 'mysql' user to connect.
After connecting you can set the password, if you would need to be
able to connect as any of these users with a password and without sudo 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/

终于安装成功了。。。

接下来,最后一步配置数据库:

# 启动mariaDB,(因为mariaDB是mysql作者写的新的数据库,其实服务和mysql是一样的,所以启动使用的是下面)
[root@iZ2ze7s2v0b78922wia32rZ ~]# service mysql start
# 安全配置
[root@iZ2ze7s2v0b78922wia32rZ ~]# mysql_secure_installation
# 输入root密码,安装后第一次启动为空,直接回车
Enter current password for root (enter for none):
# step 1: 是否切换到unix_socket安全认证,否
Switch to unix_socket authentication [Y/n] n
# step 2: 更改密码,选择修改
Change the root password? [Y/n] y
# step 3: 移除匿名用户,选择是
Remove anonymous users? [Y/n] y
# step 4: 是否允许root远程登录,根据个人需求,因为我是测试服务器选择允许
Disallow root login remotely? [Y/n] y
# step 5: 移除test数据库
Remove test database and access to it? [Y/n] y
# step 6: 重新加载权限表
Reload privilege tables now? [Y/n] y
# 看到下面,说明成功啦!!!
All done! If you've completed all of the above steps, your MariaDB
installation should now be secure.
Thanks for using MariaDB!

测试

登录数据库:

[root@iZ2ze7s2v0b78922wia32rZ ~]# mysql -u root -p

修改root远程连接权限

MariaDB [(none)]> grant all privileges on *.* to 'root'@'%' identified by 'your password';
Query OK, 0 rows affected (0.001 sec) MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.000 sec)

客户端远程连接

CentOS7中安装MariaDB的更多相关文章

  1. MariaDB Centos7 下安装MariaDB

    Centos7 下安装MariaDB by:授客 QQ:1033553122 1.下载安装文件 rpm包为例,对于标准服务器安装,至少需要下载client,shared,serve文件(安装时如果少了 ...

  2. 在centos7中安装Robot Framework

    安装前景介绍: 最初,我们是在Windows环境下搭建Robot Framework来对我们的服务进行接口测试的(想知道如何在Windows下安装Robot Framework,可以参考我同事的博客h ...

  3. centos7中安装、配置、验证、卸载redis

    本文介绍在centos7中安装.配置.验证.卸载redis等操作,以及在使用redis中的一些注意事项. 一 安装redis 1 创建redis的安装目录 利用以下命令,切换到/usr/local路径 ...

  4. centos7中安装mongodb3.6

    centos7中安装mongodb3.6 首先更新系统 yum -y update 1.安装Mongodb 编辑Mongodb安装源 vim /etc/yum.repos.d/mongodb-org- ...

  5. 在Centos7中安装elasticsearch5.5

    在Centos7中安装elasticsearch5.5 第一步:必须要有jre支持 elasticsearch是用Java实现的,跑elasticsearch必须要有jre支持,所以必须先安装jre ...

  6. centos7中安装mysql

    centos7中安装mysql网上已经很多资源了,我就不在赘述了.我这里只是记录下我安装的时候出现的一些问题. 原文:https://www.cnblogs.com/bigbrotherer/p/72 ...

  7. 在Linux中安装MariaDB并添加远程访问

    在Linux中安装MariaDB并添加远程访问 最近学习到了数据库部分,因为有一台台式机一台笔记本换着用,就没有把数据库安装在本机,本来打算用之前买的虚拟空间的数据库的,结果速度太慢用起来太难受了,就 ...

  8. CentOS7下安装MariaDB

    环境:Window10 上建立 VMWare 虚拟机,EasyInstaller 方式安装 CentOS 7 1. “失败”的经历 备份原 repo 文件,并更改 yum 源(方法详见修改yum源)为 ...

  9. CentOS7 中安装 MySQL

    0. 说明 参考 centos7.2安装MySQL CentOS 7 下 Yum 安装 MySQL 5.7 两种方式安装 MySQL 安装 MySQL(yum) & 安装 MySQL(yum) ...

随机推荐

  1. 微服务架构 ------ Day01 微服务架构优缺点

    1. 微服务架构的优点 庞大的单体程序 -> 一套微型程序. 每一个服务有明确的边界(服务之间的消息通讯机制) ,每一个服务都能单独的开发和维护,并且更好理解 每一个服务都能由一个团队来开发,当 ...

  2. Spring Data - Spring Data JPA 提供的各种Repository接口

    Spring Data Jpa 最近博主越来越懒了,深知这样不行.还是决定努力奋斗,如此一来,就有了一下一波复习 演示代码都基于Spring Boot + Spring Data JPA 传送门: 博 ...

  3. 使用haproxy实现负载均衡集群

    一.HAProxy概述: HAProxy提供高可用性.负载均衡以及基于TCP和HTTP应用的代理,支持虚拟主机,它是免费.快速并且可靠的一种解决方案.根据官方数据,其最高极限支持10G的并发. HAP ...

  4. (二)AS给button添加点击事件

    三种方法给Button添加点击事件 (一)通过button的id,添加继承View.OnClickListener的监听实现 <Button android:id="@+id/btn_ ...

  5. MONGODB-LINUX 安装步骤

    1.MongoDB 提供了 linux 各发行版本 64 位的安装包,你可以在官网下载安装包. 下载地址:https://www.mongodb.com/download-center#communi ...

  6. 证明:S = 1 + 1/2 + 1/4 + 1/8 + 1/16 + ·······,求证 S = 2

    证: S = 1 + 1/2 + 1/4 + 1/8 + 1/16 + ······· (式1) 将式1左右两边除以2,得: S/2 = 1/2 + 1/4 + 1/8 + 1/16 + 1/32 + ...

  7. 学习笔记43_T4模板

    新建-文本模板(后缀为.tt) <#@ template debug="false" hostspecific="false"  language=&qu ...

  8. 关于B/S模式CGI上传文件,遇到的问题归纳(待更新。。。)

    由于项目问题是基于web的,最近一直在改进web界面,由于产品需要升级,而且升级操作是由客户在web端完成,将软件包放在本地,由web上传到后台完成更新,之前做的是TFTP更新方式,但是需要借助第三方 ...

  9. TCP/IP协议第一卷第一章

    1.链路层 链路层有时也称作数据链路层或网络接口层,通常包括操作系统中的设备驱动程序和计算机中对应的网络接口卡.它们一起处理与电缆(或其他任何传输媒介)的物理接口细节.把链路层地址和网络层地址联系起来 ...

  10. [考试反思]1023csp-s模拟测试83:等候

    分数倒是依旧那么烂,但是这个时间比较诡异. 6分49秒弄出T1,15分钟送上T2的50分暴力,不到一小时半的时候T3的30分暴力也完成了... 在85分钟之后一次提交也没有 前15分钟平均每分钟得10 ...