惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Secure Thoughts
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
GbyAI
GbyAI
L
LINUX DO - 最新话题
A
Arctic Wolf
T
Tor Project blog
G
GRAHAM CLULEY
I
InfoQ
博客园_首页
IT之家
IT之家
The Register - Security
The Register - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
P
Proofpoint News Feed
The GitHub Blog
The GitHub Blog
Blog — PlanetScale
Blog — PlanetScale
N
Netflix TechBlog - Medium
K
Kaspersky official blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
U
Unit 42
PCI Perspectives
PCI Perspectives
量子位
P
Palo Alto Networks Blog
S
Securelist
T
Troy Hunt's Blog
博客园 - 【当耐特】
Recorded Future
Recorded Future
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
S
Security Affairs
Engineering at Meta
Engineering at Meta
T
The Blog of Author Tim Ferriss
博客园 - 聂微东
罗磊的独立博客
N
News and Events Feed by Topic
人人都是产品经理
人人都是产品经理
B
Blog RSS Feed
NISL@THU
NISL@THU
C
Cisco Blogs
T
Threatpost
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
T
The Exploit Database - CXSecurity.com
Cloudbric
Cloudbric
Cyberwarzone
Cyberwarzone
Google DeepMind News
Google DeepMind News
C
Cyber Attacks, Cyber Crime and Cyber Security

博客园 - vsignsoft

Apache Doris 编译 Tensorflow 模型保存与调用 制作 macOS Mojave 映像文件 编程实现文件重定向 openssh 免用户名/密码/服务器地址,登录远程服务器 FreeSWITCH 增加模块 mod_ilbc 解析 iOS crash 文件 私有地址与公网地址的转换 Supervisor 自动管理进程 使用 uWSGI 部署 Flask web 应用 安装 Flask macOS 上创建 Windows 兼容的 iso镜像文件 公式 X/N = int(H/N) * 65536 + [rem(H/N) * 65536 + L]/N 的运用 在VirtualBox 里安装纯DOS,进行汇编编程实践 Xcode 6、7 打包 苹果笔记本电脑,开不了机经验记录 CST时间转换成 yyyy-MM-dd格式 git 常规使用小结 XCode6 开发本地化应用
CentOS7 安装 mysql-8.0.25-el7-x86_64.tar.gz
vsignsoft · 2021-05-18 · via 博客园 - vsignsoft

下载好安装包:mysql-8.0.25-el7-x86_64.tar.gz

假设解压后的目录为: /opt/mysql/mysql-8.0.25-el7-x86_64

1、修改脚本

进入该目录下的脚本文件: support-files/mysql.server

根据脚本内容,假设设置变量为:

basedir=/opt/mysql/mysql-8.0.25-el7-x86_64
datadir=/opt/mysql/data

basedir 表示mysql安装包家目录;

datadir 表示存放数据文件的目录;

2、编辑配置文件 /etc/my.cnf 

[mysqld]
datadir=/opt/mysql/data
# socket=/opt/mysql/mysql-8.0.25-el7-x86_64/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd 

[mysqld_safe]
log-error=/var/log/mariadb/mariadb.log
pid-file=/var/run/mariadb/mariadb.pid

# include all files from the config directory
!includedir /etc/my.cnf.d

确保 datadir 跟步骤1 一致;

3. 创建mysql  组及用户

groupadd mysql
useradd -r -g mysql -s /bin/false mysql

4. 设置用户 mysql 拥有mysql数据目录及mysql家目录权限

chown -R mysql:mysql /opt/mysql/data
chown -R mysql:mysql /opt/mysql/mysql-8.0.25-el7-x86_64

5. 生成mysql数据文件

在 /opt/mysql/mysql-8.0.25-el7-x86_64 目录里,运行:

./bin/mysqld --user=mysql --base=/opt/mysql/mysql-8.0.25-el7-x86_64 --datadir=/opt/mysql/data --initialize

6、启动mysql服务

在 /opt/mysql/mysql-8.0.25-el7-x86_64 目录里,运行:

./support-files/mysql.server start