1、CentOS 7.6最小化方式安装系统后,其yum默认base源中的mariadb-server版本为5.5.60,且没有mariadb-client软件包
2、配置下载MariaDB的yum源:
# vim /etc/yum.repos.d/MariaDB.repo
[mariadb]
name=MariaDB Repo
baseurl=http://mirrors.ustc.edu.cn/mariadb/yum/10.3/centos7-amd64/
gpgkey=http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
gpgcheck=1
enabled=1
# yum clean all
# yum makecache
3、在新配置的mariadb源中MariaDB-server的最新版本为10.3.14,且MariaDB-client的最新版本也为10.3.14
4、安装启动MariaDB-server:
# yum -y install MariaDB-server
# systemctl start mariadb.service
# ss -tunlp | grep 3306
# systemctl enable mariadb.service
# systemctl status mariadb.service
# mysql_secure_installation
5、简单修改配置文件server.cnf:
# vim /etc/my.cnf.d/server.cnf
[mysqld]
port=3306
socket=/var/lib/mysql/mysql.sock
datadir=/var/lib/mysql
log-error=/var/log/mariadb.log
lower_case_table_names=1
character-set-server=utf8mb4
collation-server=utf8mb4_unicode_ci
symbolic-links=0
备注:MariaDB Server 10.3.14的版本中默认主配置文件不再是/etc/my.cnf,而是my.cnf以及/etc/my.cnf.d/目录下的各类.cnf配置文件
# systemctl restart mariadb.service
6、授权远程用户登录:
# mysql -uroot -p
MariaDB> grant all on *.* to 'root'@'192.168.%.%' identified by '123456';
MariaDB> flush privileges;
7、 使用客户端工具Navicat远程连入MariaDB:
转载于:https://blog.51cto.com/qiuyue/2382999