CentOS 7.6 yum方式安装MariaDB

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;

image.png

7、 使用客户端工具Navicat远程连入MariaDB:

image.png


相关文章

安装开始...1.打开“https://dev.mysql.com/downloadsepo/yu...
安装Helm3#官网下载慢#wgethttps://get.helm.sh/helm-v3.5.4...
通过Linux命令行启动用的指令:systemctlstartmariadb.servi...
InstallingMariaDBServer10.4TodeployMariaDBCommunityServe...
阅读目录一什么是存储引擎二mysql支持的存储引擎三使用存储引...
1、安装MariaDB安装命令yum-yinstallmariadbmariadb-server安...