1、创建MariaDB.repo
vi /etc/yum.repos.d/Mariadb.repo
2、将以下文件中的字段添加到MariaDB.repo文件中
# MariaDB 10.3 CentOS repository list - created 2016-12-01 03:36 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.3/centos7-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1
国内配置可采用如下配置:
# MariaDB 10.3 CentOS repository list - created 2017-07-03 06:59 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64 gpgkey=https://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1
3、yum安装MariaDB
yum -y install MariaDB-server MariaDB-client
4、启动MariaDB服务
systemctl start mysql.service
5、卸载
yum -y remove mari*
rm -rf /var/lib/mysql/*
6、配置
vi /etc/my.cnf.d/server.cnf
(1)、datadir指向的路径
(2)、忽略大小写
datadir=/data/mysql_data socket=/var/lib/mysql/mysql.sock character_set_server=utf8 slow_query_log=on slow_query_log_file=/data/mysql_data/slow_query_log.log long_query_time=2 lower_case_table_names=1