mysql 5.7 的 /etc/my.cnf 参数介绍
时间:2022-05-30 13:58:43|栏目:MySQL|点击: 次
下面是 mysql 5.7 的 /etc/my.cnf 的一些常用参数,自己记录一下,随时补充完善。
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
[client] port = 3306 default-character-set=utf8mb4 socket=/tmp/mysql.sock [mysql] #prompt="u@h :d r:m:s> " prompt="u@h R:m:s [d]> " #no-auto-rehash auto-rehash default-character-set=utf8mb4 socket=/tmp/mysql.sock [mysqld] ########################## # summary ########################## skip_name_resolve = on #skip-grant-tables #skip-networking bind-address = 0.0.0.0 port = 3306 basedir=/usr/local/mysql datadir=/data/mysql socket=/tmp/mysql.sock tmpdir = /tmp pid-file=/tmp/mysqld.pid explicit_defaults_for_timestamp=1 lower_case_table_names=1 table_open_cache = 8000 transaction_isolation = 'REPEATABLE-READ' ########################## # time out ########################## connect_timeout = 20 wait_timeout = 300 interactive_timeout = 300 ########################## # connection ########################## max_connections = 2000 max_user_connections = 1900 max_connect_errors = 100000 max_allowed_packet = 1G ########################## # character set ########################## character-set-server = utf8mb4 collation-server = utf8mb4_bin ########################## # log bin ########################## server-id = 1 log_bin = mysql-bin # ROW、STATEMENT、MIXED binlog_format = row sync_binlog = 1 expire_logs_days = 7 binlog_cache_size = 128m max_binlog_cache_size = 512m max_binlog_size = 256M master_info_repository=TABLE log_slave_updates=ON binlog_checksum=none #binlog_ignore_db=information_schema #binlog_ignore_db=mysql #binlog_ignore_db=performation_schema #binlog_ignore_db=sys #binlog_do_do= replicate_ignore_db=information_schema replicate_ignore_db=mysql replicate_ignore_db=performance_schema replicate_ignore_db=sys #replicate_do_db= ########################## # gtid ########################## gtid_mode = on enforce_gtid_consistency = on ########################## # slave parallel ########################## slave_net_timeout=60 slave_parallel_type=LOGICAL_CLOCK slave_parallel_workers=4 ########################## # log relay ########################## relay_log_info_repository=TABLE relay_log = mysql-relay-bin relay_log_purge = on relay_log_recovery = on max_relay_log_size = 1G ########################## # log error ########################## log_error=/data/mysql/mysqld_error.log ########################## # log slow ########################## slow_query_log = on slow_query_log_file = /data/mysql/mysqld_slow.log long_query_time = 2 log_queries_not_using_indexes = on ########################## # log general ########################## general_log = on general_log_file = /data/mysql/mysqld_gener.log ########################## # thread pool,Enterprise edition ########################## #thread_handling=pool-of-threads #thread_handling=one-thread-per-connection #thread_pool_oversubscribe=8 ########################## # innodb ########################## innodb_buffer_pool_size=2G innodb_buffer_pool_instances=2 innodb_adaptive_flushing=on innodb_file_per_table=1 innodb_log_file_size=1024M innodb_log_buffer_size=64M max_prepared_stmt_count=150000 innodb_flush_log_at_trx_commit=1 innodb_max_dirty_pages_pct=50 ########################## # password policy # after init ########################## #validate_password_policy=0 #validate_password_length=4 #validate_password_mixed_case_count=0 #validate_password_number_count=0 #validate_password_special_char_count=0
您可能感兴趣的文章
- 05-31MySQL中的 inner join 和 left join的区别解析(小结果集驱动大结果集)
- 05-31MySQL索引失效十种场景与优化方案
- 05-31MYSQL 高级文本查询之regexp_like和REGEXP详解
- 05-31MySQL获取binlog的开始时间和结束时间(最新方法)
- 05-31MySQL索引查询的具体使用
- 05-31基于MySQL和Redis扣减库存的实践
- 05-31关于MySQL的存储过程与存储函数
- 05-31MySQL实战文章(非常全的基础入门类教程)
- 05-31MySQL Flink Watermark实现事件时间处理的关键技术
- 05-31MySQL Flink实时流处理的核心技术之窗口机制
阅读排行
推荐教程
- 05-30Navicat for MySQL 11注册码激活码汇总
- 05-27Mysql误删数据快速恢复
- 05-31VS2022连接数据库MySQL并进行基本的表的操作指南
- 05-30解决seata不能使用mysql8版本的问题方法
- 05-30MYSQL字符集设置的方法详解(终端的字符集)
- 05-30解决MySQL启动报错:ERROR 2003 (HY000): Can't con
- 05-30关于Mysql-connector-java驱动版本问题总结
- 11-22mac下安装mysql忘记密码的修改方法
- 05-30MySQL中的隐藏列的具体查看
- 11-22mysql exists与not exists实例详解