MariaDB yum 安装

一、创建MariaDB.repo文件

打开MariaDB.repo文件后写入源配置

vim /etc/yum.repos.d/MariaDB.repo

1.1、CentOS 6.x的源配置

[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos6-amd64
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

1.2、CentOS 7.x的源配置

[mariadb]
name = MariaDB
baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.1/centos7-amd64/
gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1

1.3、导入GPG key

rpm --import https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

二、运行安装命令安装MariaDB

yum makecache
yum -y install MariaDB-server MariaDB-client

三、启动

3.1、CentOS 6.x 启动

service mysql start #启动服务
chkconfig mysql on #加入开机自启动

3.2、CentOS 7.x 启动

systemctl start mariadb.service #启动服务
systemctl enable mariadb.service #开机自启动

四、登录配置

4.1、执行下面命令进行配置

mysql_secure_installation

4.2、开始配置

4.2.1、首先是设置密码,会提示先输入密码

Enter current password for root (enter for none):<–初次运行直接回车

4.2.2、设置密码

Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车
New password: <– 设置root用户的密码
Re-enter new password: <– 再输入一次你设置的密码

4.2.3、其他配置

Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车
Disallow root login remotely? [Y/n] <–是否禁止root远程登录,回车(后面授权配置)
Remove test database and access to it? [Y/n] <– 是否删除test数据库,回车
Reload privilege tables now? [Y/n] <– 是否重新加载权限表,回车

参考资料

官方源:https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna
中科大源:http://mirrors.ustc.edu.cn/help/mariadb.html#fedora-centos-red-hat

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值