当前位置:网站首页>mysql5.7安装部署-yum安装
mysql5.7安装部署-yum安装
2022-08-10 10:20:00 【InfoQ】
1. mysql安装方式
2. 安装包下载

wget https://cdn.mysql.com/archives/mysql-5.7/mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar
tar -xvf mysql-5.7.37-1.el7.x86_64.rpm-bundle.tar
yum localinstall -y ./mysql-community-*.rpm
3. 简单配置与初始化
[[email protected]]
# 这个配置段配置的是3306这个mysql实例的参数,如果有多实例,比如加一个3307的mysql,再加一个配置段,参考下面的配置稍微改一下就行
innodb_buffer_pool_size = 5000M
# server_id的值,局域网内,不同实例的值要设置为不同的
server_id=106
#log_slave_updates=1
port = 3306
datadir=/home/my3306
socket=/home/my3306/mysql.sock
log-error=/home/my3306/mysqld.log
pid-file=/home/my3306/mysqld.pid
log_bin=mysql-201-binlog
# gitid最好是开启
gtid_mode=ON
enforce-gtid-consistency=ON
max_connections=2048
slow_query_log=ON
binlog_format=row
skip-name-resolve
log-slave-updates=1
relay_log_purge=0
back_log=128
wait_timeout=60
interactive_timeout=7200
key_buffer_size=16M
#query_cache_size=64M
#query_cache_type=1
#query_cache_limit=50M
max_connect_errors=20
sort_buffer_size=2M
max_allowed_packet=32M
join_buffer_size=2M
thread_cache_size=200
innodb_buffer_pool_size=1024M
innodb_flush_log_at_trx_commit=1
innodb_log_buffer_size=32M
innodb_log_file_size=128M
innodb_log_files_in_group=3
binlog_cache_size=2M
max_binlog_cache_size=8M
max_binlog_size=512M
expire_logs_days=7
read_buffer_size=2M
read_rnd_buffer_size=2M
bulk_insert_buffer_size=8M
mkdir -pv /home/my3306
chown -R mysql.mysql /home/my3306
systemctl start [email protected]
# 注意,不是systemctl start mysqld,因为后面要考虑mysql多实例
cd /home/my3306
grep pass mysqld.log
mysql -uroot -S /home/my3306/mysql.sock -p
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '[email protected]';
use mysql;
create user [email protected]'172.16.0.%' identified by '[email protected]';
grant all privileges on *.* to [email protected]'10.91.0.%' with grant option;
# 或者是
grant all privileges on *.* to 'user02'@'172.16.0.%' identified by '[email protected]' with grant option;
grant all privileges on test.* to 'user03'@'172.16.0.%' identified by '[email protected]' with grant option;
grant select on test.* to 'user04'@'172.16.0.%' identified by '[email protected]' with grant option;
# 设置服务开机启动
systemctl enable [email protected]
# 重启服务
systemctl restart [email protected]
# 启动
systemctl start [email protected]
# 停止
systemctl stop [email protected]
边栏推荐
- ESP8266 教程1 — ESP8266硬件平台介绍
- 讯飞翻译机抢镜背后,跨语种沟通迈入全新时代
- Regarding the missing json converter, the error message is: No converter found for return value of type
- 《MySQL高级篇》六、索引的创建与设计原则
- 组合模式:Swift 实现
- Load balancing principle analysis and source code interpretation
- 序列化技术ProtoBuf
- LCD DRM component 框架分析
- 交换 生成树 知识总结
- 【C语言】头文件#include <conio.h>,conio是Console Input/Output(控制台输入输出)
猜你喜欢
String interception function in SQL
Which is the strongest workflow engine for "Technology Selection"?Chief Architecture Helps You Pick
对话陈赐靓:哪吒要让高端产品大众化
【Azure云】服务端点和私有链接有什么区别?观点(1)
网络安全笔记6——数字证书与公钥基础设施
在兄弟连战狼班参加PHP培训做行业领先人才
ESP8266 Tutorial 1 - Introduction to ESP8266 Hardware Platform
跨公网环境,路由策略,进行设备的访问
ESP8266 教程1 — ESP8266硬件平台介绍
【物联网架构】什么是物联网平台?
随机推荐
用.bat文件做Airtest脚本的多设备批量运行
WebView2 通过 PuppeteerSharp 实现爬取 王者 壁纸 (案例版)
"Chief Engineer" Principal (Principal) engineer's way of training
Redis(六)——Redis6的事务和锁机制(未完成,待补)
14道高频手写JS面试题及答案,巩固你的JS基础
3D旋转文本动画js特效
Regarding the missing json converter, the error message is: No converter found for return value of type
定时任务Quartz
PPT | 「课件」企业中高层人员安全管理培训(118页)
Text selection rounded style border-radius
Dalian University of Technology & Pengcheng & UAE propose a mixed-scale triple network ZoomNet for camouflaged target detection, with SOTA performance!
Payment x Aggregation x Ledger Separation - The Way to Avoid Risk of "Erqing" on the Return Platform
反射效率为什么低?
vs2012创建WCF应用程序
what is rtems
《MySQL高级篇》六、索引的创建与设计原则
Network Security Note 6 - Digital Certificates and Public Key Infrastructure
[Azure Cloud] What is the difference between a service endpoint and a private link?point of view (1)
【FAQ】【Push Kit】 华为怎么设置角标
跨公网环境,路由策略,进行设备的访问