1. 程式人生 > >centos7 安裝mariadb

centos7 安裝mariadb

mariadb

centos7 安裝mariadb

一、使用國內源:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-
Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo
http://mirrors.aliyun.com/repo/Centos-7.repo

二、安裝mariadb
yum -y install mariadb mariadb-server mariadb-devel

三、cat /etc/my.cnf
[mysqld]

default-storage-engine = innodb
innodb_file_per_table

collation-server = utf8_general_ci
init-connect = ‘SET NAMES utf8‘
character-set-server = utf8

四、啟動mariadb
root用戶直接啟動,由於我的環境是vagrant ssh連接的,默認的是vagran用戶

systemctl start mariadb    #用root用戶啟動,非root用戶需要sudo
mysql

centos7 安裝mariadb