当前位置:网站首页>MySQL配置参数和命令
MySQL配置参数和命令
2022-04-22 17:08:00 【shaobohong】
| 参数 | 说明 | 默认值 |
| wait_timeout | 连接器等待时间 | 8小时 |
| query_cache_type | 查询缓存。建议设置成DEMAND(不使用),因为一旦对表进行更新,就会清空缓存,缓存的命中率很低,在8.0版本中废弃 | |
| innodb_flush_log_at_trx_commit | 设置成1,每次事务的redo log都直接持久化到磁盘,保证MySQL异常重启数据不丢失 | |
| sync_log | 设置成1,每次事务的binlog都直接持久化到磁盘,保证MySQL异常重启数据不丢失 | |
| transaction_isolation | READ-UNCOMMIT(读未提交) READ-COMMIT(读提交) REPEATABLE-READ(可重复读) SERIALIZABLE(可串行化) set global transaction_isolation=0或(1/2/3)分别设置为以上4种隔离级别 |
|
| autocommit | 自动提交事务。建议设置成1,每个sql都自动提交,要使用事务时再显示定义 | |
| innodb_lock_wait_timeout | 等待锁超时时间, | 50s |
| innodb_deadlock_detect | 死锁检测,设置为on,表示开启 | |
| innodb_change_buffer_max_size | 当设置为50时,表示最多占用buffer pool的50% | |
| innodb_io_capacity | 告诉Innodb磁盘能力,用于刷脏页。建议设置成磁盘的 IOPS | |
| innodb_max_dirty_pages_pct | 脏页比例上限 | 75% |
| innodb_flush_neighbors | 控制刷脏页时是否把邻近的脏页也一起刷了。 值为 1 的时候会有上述的“连坐”机制,值为 0 时表示不找邻居,自己刷自己的。 如果使用固态硬盘,建议设置为0 |
8.0版本中默认0 |
| innodb_file_per_table | OFF :表的数据放在系统共享表空间,也就是跟数据字典放在一起 ON :每个 InnoDB 表数据存储在一个以 .ibd 为后缀的文件中 建议设置为ON |
5.6.6默认ON |
show processlist 显示进程
mysql_reset_connection 重新初始化连接资源,避免长连接长时间积累导致内存占用太大
Flush tables with read lock 加全局读锁,用于数据库备份
start transaction with consistent snapshot 立即启动事务
alter table A engine=InnoDB 重建表
版权声明
本文为[shaobohong]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_17613195/article/details/107027328
边栏推荐
- JS中递归返回值为undefined
- Knowing that it is listed in Hong Kong, it is the first Chinese concept stock to return to Hong Kong with dual main listing
- js 获取汉字首字符
- Why do you have to override the hashcode method to override the equlas method
- KNN and K-means from introduction to actual combat
- Remix connects the test chain and the arbor layer 2 network
- 红杉中国带队,投了两位女创始人
- SDN学习之Opendaylight浅析(一)
- 混合背包呀
- Jiaoxia is following the old path of perfect diary
猜你喜欢
![[unity] make aim IK 1 with animation rig](/img/52/b8ee9d0982a8671356954fbbad775d.png)
[unity] make aim IK 1 with animation rig
![[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)](/img/b1/035c907253739a3e8c68b5934fd4e0.png)
[Golang]力扣Leetcode - 657. 机器人能否返回原点(模拟)

【ES6】扩展运算符、symbol、迭代器

4亿女性刚需,各路资本杀伐:藏在卫生巾里的1000亿生意

Will Liu is a tiktok bit.

leetcode:451. 根据字符出现频率排序

Knowing that it is listed in Hong Kong, it is the first Chinese concept stock to return to Hong Kong with dual main listing

敬語 謙譲

Detonate the most bombs - C language DFS recursive approach

对数器的概念和使用
随机推荐
Concept and application of logarithm
LeetCode刷题计划——单调数列
There was another bug today. When mogodb was used to query data, it was found that the returned data was null
pip install 镜像源
Remix connects the test chain and the arbor layer 2 network
【ES6】扩展运算符、symbol、迭代器
AQS source code reading
R语言上课代码记录5
OJ每日一练——求分数序列之和
list转map 及Duplicate key.md
2022 EIA Engineer Examination case analysis exercises and answers
中金证券开户app叫什么?股票开户怎么样佣金优惠又安全?
E-commerce price data monitoring interface / brand commodity price control interface / commodity data analysis interface / price comparison search API interface, ultra detailed interface docking instr
DevExpress WPF入门指南 - 运行时生成的POCO视图模型(一)
bisect——对列表插入新数据仍然保持有序
IDEA代码重构小技巧(VIP典藏版)
MySQL_00_初识MySQL
[句型] 二十四、特殊疑问句
Triple pressure of Xiaoxiong electric appliance: expansion, inventory and competitors
刘畊宏是抖音的钻头