mysql常用参数

参数名称参数说明参考
max_connections数据库的最大连接数MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
wait_timeout非交互模式的没有操作后的超时秒数,超时后数据库会关闭该连接。MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
interactive_timeout交互模式下的没有操作后的超时时间,一般与wait_timeout的值一致MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
max_prepared_stmt_count限制一个session内最多可以有多少条预编译语句MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
innodb_lock_wait_timeout等待数据锁的超时时间默认50s,超时则回滚当前事务,可以设置适当的时长作为避免死锁的一种措施MySQL :: MySQL 8.0 Reference Manual :: 15.14 InnoDB Startup Options and System Variables
max_allowed_packet服务器和客户之间单次通信的大小上限,会限制Server接受的数据包大小。MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
slow_query_log是否开启慢日志 0关闭, 1开启MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
long_query_time如果开启了慢日志,则sql查询时间超过该值就记录到慢日志MySQL :: MySQL 8.0 Reference Manual :: 5.1.8 Server System Variables
innodb_flush_log_at_trx_commit控制提交操作的严格ACID合规性与在批量重新安排和完成提交相关I/O操作时可能实现的更高性能之间的平衡。
完全符合ACID要求需要默认设置1。日志在每次事务提交时写入并刷新到磁盘。
设置为0时,日志每秒写入并刷新到磁盘一次。未刷新日志的事务可能会在崩溃中丢失。
设置为2时,日志在每次事务提交后写入,并每秒刷新一次到磁盘。未刷新日志的事务可能会在崩溃中丢失。
MySQL :: MySQL 8.0 Reference Manual :: 15.14 InnoDB Startup Options and System Variables
sync_binlog控制MySQL服务器将二进制日志同步到磁盘的频率。
sync_binlog=0:禁用MySQL服务器将二进制日志同步到磁盘。
sync_binlog=1:启用在提交事务之前将二进制日志同步到磁盘。
sync_binlog=其他数字,表示在收集N个二进制日志提交组后,二进制日志将同步到磁盘。
MySQL :: MySQL 8.0 Reference Manual :: 17.1.6.4 Binary Logging Options and Variables
innodb_buffer_pool_instancesInnoDB缓冲池划分的区域数。仅在缓冲区大于1G时生效,默认为8MySQL :: MySQL 8.0 Reference Manual :: 15.14 InnoDB Startup Options and System Variables
innodb_buffer_pool_chunk_size缓冲池的块大小(字节)默认128MMySQL :: MySQL 8.0 Reference Manual :: 15.14 InnoDB Startup Options and System Variables
innodb_buffer_pool_size缓冲池的大小(字节),InnoDB缓存表和索引数据的内存区域。缓冲池大小必须始终等于或是innodb_Buffer_pool_chunk_size*innodb_buffer_pool_instances的倍数MySQL :: MySQL 8.0 Reference Manual :: 15.14 InnoDB Startup Options and System Variables
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值