在Centos7/Ubuntu/Debian上如何安装Mysql/Mairadb

发布时间:阅读数:859

微微CMS建议使用Mysql分支MariaDB作为数据库,根据目前的测试和使用,Mariadb的支持表现要比Mysql好一些。那么如何使用呢?如下:

在CentOS7上

1. 创建Mairadb的源文件

sudo touch  /etc/yum.repos.d/MariaDB.repo


2. 粘贴以下内容

[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.5/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1


3. 执行安装

sudo yum install MariaDB-server MariaDB-client


在Debian上


1. 添加源

sudo apt-get install software-properties-common
sudo apt-key adv --fetch-keys 'https://mariadb.org/mariadb_release_signing_key.asc'
sudo add-apt-repository 'deb [arch=amd64,arm64,ppc64el]https://mirrors.tuna.tsinghua.edu.cn/mariadb/repo/10.5/ubuntufocal main'



2. 安装

sudo apt update
sudo apt install mariadb-server


上一篇:什么是Robots协议?

下一篇:没有了