操作系统:CentOS 7.6 (Minimal安装)
MySQL版本:MySQL 8.0.23
1. 准备最基础信息的my.cnf
本案例my.cnf配置文件是最基础的初始化配置文件,只能保证mysql服务正常开启,并不适用生产环境,
关于更多关于buffer、logfile等性能参数需要根据主机的CPU、MEM/硬盘等硬件环境进行后续相应优化配置
[root@localhost home]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)
关闭防火墙和selinux
systemctl stop firewall
systemctl disable firewall
vi /etc/selinux/config
enable改成disabled
--安装之前检查系统有没有mariadb客户端,如果有建议删除
[root@localhost home]# rpm -qa|grep mariadb
mariadb-libs-5.5.60-1.el7_5.x86_64
如果不删除使用客户端连接可能会出现以下显示情况
[root@mysql]# mysql -uroot -h127.0.0.1 -p
Enter password:
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.31-log MySQL Community Server (GPL)
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MySQL [(none)]>
删除命令如下
[root@mysql]# rpm -e --nodeps mariadb-libs-5.5.60-1.el7_5.x86_64
warning: /etc/my.cnf saved as /etc/my.cnf.rpmsave
1.1 准备my.cnf 配置文件
vi /etc/my.cnf
[mysqld]
##SERVER ID