type
status
date
slug
summary
tags
category
icon
password
1、系统环境
操作系统:CentOS、Ubuntu、Red Hat。
存储:至少有512MB的内存。
selinux:关闭SELinux功能,通过MySQL本身进行安全控制。

防火墙:关闭。永久关闭

软件安装
依赖:安装依赖包 yum。
安装包:官网进行下载
MySQL:
https://downloads.mysql.com/archives/community
解压缩:建议是.tar.gz包。

基础配置
用户:mysql用户。
目录:安装目录
/usr/local/mysql
、数据存放目录/data/mysql/mysqldata
、日志目录/data/mysql/log
。权限:用户执行权限。
配置文件:根据需求、硬件合理配置 my.cnf 。
2、执行脚本
将mysql-5.7.23-linux-glibc2.12-x86_64.tar.gz安装包和mysql_auto_install.sh脚本放至/root目录

将脚本赋予执行权限

执行脚本
./installmysql_5.7.sh


安装完成

检测环境

3、卸载MySQL
关闭进程
/usr/local/mysql/support-files/mysql.server stop

删除文件

删除软连接
rm -rf /etc/init.d/mysqld
rm -rf /usr/bin/mysq

4、脚本内容
- 作者:Sangyxv
- 链接:https://sangyxv.top/article/6
- 声明:本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。