暂无图片
暂无图片
暂无图片
暂无图片
暂无图片
MySQL 8.0 二进制单机部署.pdf
206
6页
4次
2022-12-12
5墨值下载
环境 配置
操作系统 CentOS 7.9
MySQL软件 MySQL 8.0.30
软件安装路径 /usr/local/mysql
数据存储路径 /data/data
MySQL 8.0 二进制单机部署
1. 部署环境
2. 关闭防火墙
3. 关闭selinux
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
1
2
3
#
setenforce 0
#
vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#   enforcing - SELinux security policy is enforced.
#   permissive - SELinux prints warnings instead of enforcing.
#   disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#   targeted - Targeted processes are protected,
#   minimum - Modification of targeted policy. Only selected
processes are protected.
#   mls - Multi Level Security protection.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
4. 上传文件并校验
5. 是否安装MySQLmariadb
6. 解压安装包
SELINUXTYPE=targeted16
###
md5sum mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz
2469b1ae79e98110277d9b5bee301135 mysql-8.0.30-linux-glibc2.12-
x86_64.tar.xz
1
2
3
[root@mysql01 ~]# rpm -qa|grep -i mysql
[root@mysql01 ~]# rpm -qa|grep -i mariadb
mariadb-libs-5.5.68-1.el7.x86_64
[root@mysql01 ~]# rpm -e mariadb-libs-5.5.68-1.el7.x86_64
error: Failed dependencies:
libmysqlclient.so.18()(64bit) is needed by (installed) postfix-
2:2.10.1-9.el7.x86_64
libmysqlclient.so.18(libmysqlclient_18)(64bit) is needed by
(installed) postfix-2:2.10.1-9.el7.x86_64
#------------postfixmariadb-----------------
[root@mysql01 ~]# rpm -e postfix-2:2.10.1-9.el7.x86_64
[root@mysql01 ~]# rpm -e mariadb-libs-5.5.68-1.el7.x86_64
[root@mysql01 ~]# rpm -qa|grep -i mariadb
1
2
3
4
5
6
7
8
9
10
11
cd /opt
###xz
unxz mysql-8.0.30-linux-glibc2.12-x86_64.tar.xz
###tar
tar -xvf mysql-8.0.30-linux-glibc2.12-x86_64.tar
###/usr/local/mysql
mv mysql-8.0.30-linux-glibc2.12-x86_64 /usr/local/mysql
1
2
3
4
5
6
7
7. 创建用户和组
8. 创建目录赋予权限
9. 创建MySQL配置文件
10. 设置环境变量
groupadd mysql
useradd -r -g mysql -s /sbin/nologin mysql
-r
-g
-s 使shell
/sbin/nologin
1
2
3
4
5
6
7
###
mkdir -p /data/{data,logs}
###
chown -R mysql.mysql /data
chown -R mysql.mysql /usr/local/mysql
1
2
3
4
5
###
vim /etc/my.cnf
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
user=mysql
port = 3306
server_id=1
basedir = /usr/local/mysql
datadir = /data/data
socket = /tmp/mysql.sock
1
2
3
4
5
6
7
8
9
10
11
12
of 6
5墨值下载
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文档的来源(墨天轮),文档链接,文档作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。