当前位置:网站首页>mysql5.7 installation and deployment - yum installation
mysql5.7 installation and deployment - yum installation
2022-08-10 10:53:00 【InfoQ】
1. mysql installation method
2. Installation package download

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. Simple configuration and initialization
[[email protected]]
# This configuration section configures the parameters of the mysql instance of 3306, ifThere are multiple instances, such as adding a 3307 mysql, and adding a configuration section, refer to the following configuration and change it slightly
innodb_buffer_pool_size = 5000M
# The value of server_id, LANInside, the value of different instances should be set to different
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 is best to open
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]
# Note, not systemctl start mysqld, because mysql multi-instance should be considered later
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;
# or
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;
grantselect on test.* to 'user04'@'172.16.0.%' identified by '[email protected]' with grant option;
# Set the service to start up
systemctl enable [email protected]
# Restart the service
systemctl restart [email protected]
# Start
systemctl start [email protected]
# Stop
systemctl stop [email protected]
边栏推荐
- 【STL】位图的介绍使用以及代码的模拟实现
- Redis (six) - transaction and lock mechanism of Redis6 (unfinished, to be supplemented)
- 动作捕捉系统用于室内组合定位技术研究
- 14 high-frequency handwritten JS interview questions and answers to consolidate your JS foundation
- The web project accesses static resources inside the reference jar
- LeetCode Algorithm 1403. 非递增顺序的最小子序列
- 序列化技术ProtoBuf
- MongoDB database notes
- 越折腾越好用的 3 款开源 APP
- 面试官:项目中 Dao、Service、Controller、Util、Model 怎么划分的?
猜你喜欢
8月份DB-Engines 数据库排行榜最新战况
【知识论概念】《理由论的进展》鲁汶大学2022最新220页博士论文
4 面拿华为 offer 的水平,面试阿里居然一面就被吊打?
Swin Transformer作者曹越加入智源,开展视觉基础模型研究
[Concept of Theory of Knowledge] "Progress in the Theory of Reason" University of Leuven 2022 latest 220-page doctoral dissertation
哈希表,哈希桶的实现
String interception function in SQL
「首席工程师」首席(Principal )工程师修炼之道
JS高级 之 Promise 详解
Redis (three) - detailed configuration file, publish and subscribe, new data types
随机推荐
C语言空白符、空格符 与转义字符题点总结
数据库事务
Redis(六)——Redis6的事务和锁机制(未完成,待补)
企业如何判断数据治理是否成功?
OneFlow源码解析:算子指令在虚拟机中的执行
Taro小程序跨端开发入门实战
负载均衡原理分析与源码解读
ESP8266 教程2 — 烧录AT固件
js对象转FormData对象(一般用于上传)
"Time Series Database" uses cassandra to scan time series data
跨公网环境,路由策略,进行设备的访问
[C language] Header file #include
, conio is Console Input/Output (console input and output) Load balancing principle analysis and source code interpretation
【知识论概念】《理由论的进展》鲁汶大学2022最新220页博士论文
ESP8266-Arduino编程实例-MQ-8氢气传感器驱动
网络文化经营许可证
Flutter实战-请求封装(五)之Isolate线程改造
ELK框架搭建[通俗易懂]
VBA: Inputbox Function and Inputbox Method
LeetCode Algorithm 1472. 设计浏览器历史记录