①添加MariaDB的yum源

1.创建MariaDB.repo

sudo vi /etc/yum.repos.d/Mariadb.repo

2.将以下文件中的字段添加到MariaDB.repo文件中

# MariaDB 10.1 CentOS repository list - created 2016-12-01 03:36 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

②yum安装MariaDB

sudo yum -y install MariaDB-server MariaDB-client

③启动MariaDB服务

systemctl start mysql.service

④配置MariaDB服务

使用mysql_secure_installation配置MariaDB服务

mysql_secure_installation

具体设置

#由于一开始安装MariaDB数据库后, root用户默认密码为空, 所以只需要按Enter键
Enter current password for root (enter for none): #是否设置root用户的新密码
Set root password? [Y/n] y #录入新密码
New password: #确认新密码
Re-enter new password: #是否删除匿名用户,生产环境建议删除
Remove anonymous users? [Y/n] y #是否禁止root远程登录,根据自己的需求选择
Disallow root login remotely? [Y/n] n #是否删除test数据库
Remove test database and access to it? [Y/n] y #是否重新加载权限表
Reload privilege tables now? [Y/n] y

⑤开启远程访问

1.防火墙添加3306端口

查看firewall状态

firewall-cmd --state

状态是not running,启动firewall

systemctl start firewalld

状态是running

开放3306端口

firewall-cmd --zone=public --add-port=3306/tcp --permanent

重新载入

firewall-cmd --reload

2.明明之前有设置root开启远程的,但是我这里访问不了,所以重新去MariaDB赋权限

#进入Mariadb
mysql -uroot -p
#选择数据库
use mysql;
#添加权限
Grant all on *.* to 'root'@'%' identified by 'root用户的密码' with grant option;
#重新载入
flush privileges;

centos7.2使用yum安装MariaDB10.1的更多相关文章

  1. CentOS7下使用YUM安装mariadb10

    1:由于centos7 默认使用yum安装MySQL的话就会安装mariadb,只是安装的版本停留在mariadb5.x,版本比较低.如果我们需要安装mariadb10这里就需要删除mariadb-l ...

  2. CentOS7.3下yum安装MariaDB10.3.12并指定utf8字符集

    添加MariaDB的yum源,指定安装的版本,然后使用 yum 工具进行安装 参考MariaDB官方网站对应安装方法和步骤 https://downloads.mariadb.org/mariadb/ ...

  3. centos7下使用yum安装mysql

    CentOS7的yum源中默认好像是没有mysql的.为了解决这个问题,我们要先下载mysql的repo源. 1. 下载mysql的repo源 wget http://repo.mysql.com/m ...

  4. centos7下使用yum安装pip

    centos7下使用yum安装pip 首先安装epel扩展源: yum -y install epel-release 更新完成之后,就可安装pip: yum -y install python-pi ...

  5. <亲测>CentOS7中使用yum安装Nginx的方法

    CentOS7中使用yum安装Nginx的方法   最近无意间发现Nginx官方提供了Yum源.因此写个文章记录下. 1.添加源 默认情况Centos7中无Nginx的源,最近发现Nginx官网提供了 ...

  6. centos7中使用yum安装tomcat以及它的启动、停止、重启

    centos7中使用yum安装tomcat 介绍 Apache Tomcat是用于提供Java应用程序的Web服务器和servlet容器. Tomcat是Apache Software Foundat ...

  7. centos7下使用yum安装redis

    centos7下使用yum安装Redis 第一步:安装 yum –y install redis 第二步:启动 systemctl start redis.service 第三步:设置开机启动 sys ...

  8. Centos7.6使用yum安装PHP7.2

    Centos7.6使用yum安装PHP7.2 1.安装源 安装php72w,是需要配置额外的yum源地址的,否则会报错不能找到相关软件包. php高版本的yum源地址,有两部分,其中一部分是epel- ...

  9. CentOS8 yum安装Mariadb10.4

    CentOS8 yum安装Mariadb10.4 https://downloads.mariadb.org/mariadb/repositories/#distro=CentOS&distr ...

随机推荐

  1. vue2.0中vue-router使用总结

    #在vue-cli所创建的项目中使用 进入到项目的目录后使用  npm install vue-router --save  安装vue-router,同时保存在webpack.Json配置文件中,然 ...

  2. Hibernate映射关系之_多对多

    多对多关系由于效率的原因,实际中会拆成相互的一对多的关系,不再累述

  3. MSSQL事务在C#程序端的使用

    拼接成一条SQL执行 优点:简单,容易看懂: 缺点:某些场合,涉及的业务较多,在同一SQL处理显得太冗长,复杂,不利于解耦. 使用细节 在方法之间传递参数,确保多个方法中的SQL都是使用同一个事务的( ...

  4. vector 进阶

    http://classfoo.com/ccby/article/jnevK #include <iostream> #include <vector> #include &l ...

  5. UVA 11995 STL 使用

    There is a bag-like data structure, supporting two operations: 1 x Throw an element x into the bag. ...

  6. BZOJ1191:超级英雄(二分图匹配)

    [HNOI2006]超级英雄Hero 题目链接:https://www.lydsy.com/JudgeOnline/problem.php?id=1191 Description: 现在电视台有一种节 ...

  7. Drac6-Web界面无法访问

    1. ssh idracip, and reset RAC -- will need around 10mins /admin1-> racadm racreset RAC reset oper ...

  8. Junit使用的超简单介绍

    Junit使用的超简单介绍 前言:我对Junit了解的并不多,只是今天突然听到有人提到了它,而且现在时间还早,所以我觉得我不妨更一篇关于Junit4的超级超级简单的用法,全当是为了省去看官网demo的 ...

  9. Nim博弈(nim游戏)

    http://blog.csdn.net/qiankun1993/article/details/6765688 NIM 游戏 重点结论:对于一个Nim游戏的局面(a1,a2,...,an),它是P- ...

  10. 使用vs2010编辑Unity脚本,配置方法

    在Unity界面上.选择Edit->Preferences->External Tools,External Script Editor一项即为编译器. 以Unity3D 4.3.4 f1 ...