centos7 安装MariaDB 10.6
镜像下载、域名解析、时间同步请点击 阿里云开源镜像站
背景
centos7使用yum install mariadb-server命令安装的默认版本是5.5的,这是因为系统默认源只有5.5的版本,所以我们去增加一个10.6的源
增加源
去mariaDB官网找到对应的源
Download MariaDB Server - MariaDB.org
这是我选的源
复制这部分作为centos7的源
# MariaDB 10.6 CentOS repository list - created 2021-12-22 11:16 UTC
# https://mariadb.org/download/
[mariadb]
name = MariaDB
baseurl = https://mirrors.aliyun.com/mariadb/yum/10.6/centos7-amd64
gpgkey=https://mirrors.aliyun.com/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
添加maridb源
vim /etc/yum.repos.d/MariaDB.repo
把刚在mariadb官网复制的源代码粘贴进去
安装
源的问题解决了,现在可以执行安装了,再次执行该命令就会发现安装的是10.6的版本了
yum install MariaDB-server MariaDB-client
配置 MariaDB
mariadb-secure-installation
Enter current password for root (enter for none): 输入当前的root密码(默认空),直接回车
Set root password? [Y/n] 设置新密码,y
Remove anonymous users? [Y/n] 移除匿名用户,y
Disallow root login remotely? [Y/n] 禁止root用户远程登录,y
Remove test database and access to it? [Y/n] 移除测试数据库,y
Reload privilege tables now? [Y/n] y
启动MariaDB
启动
systemctl start mariadb
设置开机自启
systemctl enable mariadb
配置文件位置:/etc/my.cnf
本文转自:https://blog.csdn.net/sqlquan/article/details/122093702
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 单线程的Redis速度为什么快?
· 展开说说关于C#中ORM框架的用法!
· Pantheons:用 TypeScript 打造主流大模型对话的一站式集成库
· SQL Server 2025 AI相关能力初探
· 为什么 退出登录 或 修改密码 无法使 token 失效