yum安装mariadb10.6并配置

1 配置yum源

1.1 查找mariadb软件包地址

打开http://mirrors.aliyun.com/,查找mariadb,然后拼装地址http://mirrors.aliyun.com/mariadb/yum打开,点开想要的版本,选择对应的操作系统点进去,复制地址,我这里是http://mirrors.aliyun.com/mariadb/yum/10.6.16/centos7-amd64/

1.2 新建一个源

cat > /etc/yum.repos.d/MariaDB.repo <<'EOF'
[mariadb]
name = MariaDB
baseurl = http://mirrors.aliyun.com/mariadb/yum/10.6.16/centos7-amd64/
gpgkey =  http://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck = 1
EOF

清除缓存

yum clean all

2 安装并启动MariaDB

2.1 安装

yum install -y MariaDB-server MariaDB-client

2.2 启动

安装完成MariaDB,启动MariaDB并设置开机启动

systemctl enable --now mariadb # 等同执行一下两条命令
# 启动MariaDB
systemctl start mariadb
# 设置开机启动
systemctl enable mariadb

3 配置

# 修改root密码,默认是空
mysqladmin -u root password "Root123456!2"
# 配置允许远程访问
mysql<<'EOF'
grant all privileges on *.* to 'root'@'%' identified by "Root123456!2";
flush privileges;
EOF

4 测试远程连接mariadb数据库

mysql -h 192.168.2.14 -P3306 -uroot -p'Root123456!2'

5 参考链接

  1. 官网文档
  2. Linux系统之安装mariadb方法
  3. CentOS7安装mysql5.7
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

一点见解

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值