Centos8 安装 mariadb 最新版 10.5.x

通过官网查看
https://mariadb.org/

https://yum.mariadb.org/

最新版为 10.5.x
fox.风

设置数据源

https://mariadb.com/kb/en/yum/

这里使用的是国内源 http://mirrors.aliyun.com/mariadb/yum/10.5/centos8-amd64/

cat <<EOF > /etc/yum.repos.d/mariadb.repo
[mariadb]
name = mariadb
baseurl=http://mirrors.aliyun.com/mariadb/yum/10.5/centos8-amd64/
gpgkey=https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB 
#enabled=1
gpgcheck=1
EOF

复制到 终端直接执行

更新缓存

dnf clean all  
dnf makecache  
dnf repolist

显示可安装的版本

# 这个可以看版本号
dnf search mariadb --showduplicates  --disablerepo=AppStream
或
dnf search mariadb

--disablerepo=AppStream 禁用仓库标识为 AppStream 的主软件仓库

安装

现在安装的就是 最新的版本了

dnf -y install MariaDB-server MariaDB-client  --disablerepo=AppStream

--disablerepo=AppStream 禁用仓库标识为 AppStream 的主软件仓库

命令

设置密码

mysql_secure_installation

设置开机启动

systemctl enable mariadb --now

启动 mariadb

systemctl start mariadb

创建新超级管理用户 fox

在 shell 中输入

mysql -uroot -p
#输入 root 的 管理密码

下面 每次执行一条

use mysql;

#创建用户 并设置密码
create user 'fox'@'%' identified by '123456';


#授权 fox  拥有 所有权限
grant all privileges   on *.* to 'fox'@'%' identified by '123456'  WITH GRANT OPTION; 

# 刷新权限
flush privileges;

#退出
exit;

允许 root 远程登录

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
flush privileges;

https://blog.csdn.net/fenglailea/article/details/92265661

  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

风.foxwho

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

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

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

打赏作者

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

抵扣说明:

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

余额充值