一、概述作为DBA或系统运维人员在安装或配置MySQL的过程中 , 经常遇到mysql的配置文件参数不知如何设置?哪些参数需要设置?参数值设置为多少比较合理 。下面分享一个在线生成mysql的生成器 , 帮你解决以上烦忧 。
文章插图
二、过程2.1 填写相关配置
1、填写相关参数 , 点击生成 。
文章插图
2、填写参数说明
- CPU:CPU逻辑核数
- 内存大小:部署mysql机器内存大小
- 磁盘类型:SSD或HDD
- MYSQL版本:5.6、5.7、8.0
- 架构:单机、主从、MGR
- basedir:程序目录
- datadir:数据目录的父目录
- 监听端口:3306
2.2 生成配置文件展示
配置说明:
- CPU:4核
- 内存:16G
- 磁盘:SSD
- MYSQL版本:5.7
- 架构:单机
- base_dir:/usr/local/mysql/
- datadir:/data/mysql/data/
【分享mysql配置文件my.cnf一键生成器】[mysql]auto-rehashsocket =/tmp/mysql.sock # /tmp/mysql.sock??[mysqld]####: for globaluser =mysql # mysqlbasedir =/usr/local/mysql/ # /usr/local/mysql/datadir =/data/mysql/data/3306/ # /usr/local/mysql/dataserver_id =1980 # 0port =3306 # 3306character_set_server =utf8 # latin1log_bin_trust_function_creators =ON # 0max_prepared_stmt_count =1048576 # log_timestamps =system # utcsocket =/tmp/mysql.sock # /tmp/mysql.sockread_only =OFF # offskip_name_resolve =1 # 0auto_increment_increment =1 # 1auto_increment_offset =1 # 1lower_case_table_names =1 # 0secure_file_priv = # nullopen_files_limit =65536 # 1024max_connections =512 # 151thread_cache_size =64 # 9table_open_cache =4000 # 2000table_definition_cache =2000 # 1400table_open_cache_instances =32 # 16?####: for binlogbinlog_format =ROW # rowlog_bin =mysql-bin # offbinlog_rows_query_log_events =ON # offlog_slave_updates =ON # offexpire_logs_days =7 # 0binlog_cache_size =96k # 65536(64k)binlog_checksum =none # CRC32sync_binlog =1 # 1slave-preserve-commit-order =ON # ?####: for error-loglog_error =err.log # /usr/local/mysql/data/localhost.localdomain.err?####: for general-loggeneral_log =OFF # offgeneral_log_file =general.log # hostname.log?####: for slow query logslow_query_log =ON # offslow_query_log_file =slow.log # hostname.loglog_queries_not_using_indexes =OFF # offlong_query_time =2.0 # 10.000000?####: for gtidgtid_executed_compression_period =1000 # 1000gtid_mode =ON # offenforce_gtid_consistency =ON # off??####: for replicationskip_slave_start =0 # master_info_repository =table # filerelay_log_info_repository =table # fileslave_parallel_type =logical_clock # database | LOGICAL_CLOCKslave_parallel_workers =4 # 0rpl_semi_sync_master_enabled =1 # 0rpl_semi_sync_slave_enabled =1 # 0rpl_semi_sync_master_timeout =1000 # 1000(1 second)plugin_load_add =semisync_master.so #plugin_load_add =semisync_slave.so #binlog_group_commit_sync_delay =4000 # 0 4000(4ms) binlog_group_commit_sync_no_delay_count = 10 # 0binlog_transaction_dependency_tracking = WRITESET # COMMIT_ORDER | WRITESET transaction_write_set_extraction = XXHASH64??####: for innodbdefault_storage_engine =innodb # innodbdefault_tmp_storage_engine =innodb # innodbinnodb_data_file_path =ibdata1:256M;ibdata2:256M:autoextend # ibdata1:12M:autoextendinnodb_temp_data_file_path =ibtmp1:64M:autoextend # ibtmp1:12M:autoextendinnodb_buffer_pool_filename =ib_buffer_pool # ib_buffer_poolinnodb_log_group_home_dir =./ # ./innodb_log_files_in_group =8 # 2innodb_log_file_size =128M # 50331648(48M)innodb_file_per_table =ON # oninnodb_online_alter_log_max_size =128M # 134217728(128M)innodb_open_files =64000 # 2000innodb_page_size =16k # 16384(16k)innodb_thread_concurrency =0 # 0innodb_read_io_threads =4 # 4innodb_write_io_threads =4 # 4innodb_purge_threads =4 # 4(garbage collection)innodb_page_cleaners =4 # 4(flush lru list)innodb_print_all_deadlocks =ON # offinnodb_deadlock_detect =ON # oninnodb_lock_wait_timeout =50 # 50innodb_spin_wait_delay =6 # 6innodb_autoinc_lock_mode =2 # 1innodb_flush_sync =OFF # oninnodb_io_capacity =4000 # 200innodb_io_capacity_max =20000 # 2000#--------Persistent Optimizer Statisticsinnodb_stats_auto_recalc =ON # oninnodb_stats_persistent =ON # oninnodb_stats_persistent_sample_pages =20 # 20innodb_buffer_pool_instances =10 # 1innodb_adaptive_hash_index =ON # oninnodb_change_buffering =all # allinnodb_change_buffer_max_size =25 # 25innodb_flush_neighbors =0 # 1innodb_flush_method =O_DIRECT # innodb_doublewrite =ON # oninnodb_log_buffer_size =256M # 16777216(16M)innodb_flush_log_at_timeout =1 # 1innodb_flush_log_at_trx_commit =1 # 1innodb_buffer_pool_size =10G # 128Mautocommit =ON # 1#--------innodb scan resistantinnodb_old_blocks_pct =37 # 37innodb_old_blocks_time =1000 # 1000#--------innodb read aheadinnodb_read_ahead_threshold =56 # 56 (0..64)innodb_random_read_ahead =off # OFF#--------innodb buffer pool stateinnodb_buffer_pool_dump_pct =50 # 25 innodb_buffer_pool_dump_at_shutdown =ON # ONinnodb_buffer_pool_load_at_startup =ON # ON?????#### for performance_schemaperformance_schema =on # onperformance_schema_consumer_global_instrumentation =on # onperformance_schema_consumer_thread_instrumentation =on # onperformance_schema_consumer_events_stages_current =on # offperformance_schema_consumer_events_stages_history =on # offperformance_schema_consumer_events_stages_history_long =off # offperformance_schema_consumer_statements_digest =on # onperformance_schema_consumer_events_statements_current =on # onperformance_schema_consumer_events_statements_history =on # onperformance_schema_consumer_events_statements_history_long =off # offperformance_schema_consumer_events_waits_current =on # offperformance_schema_consumer_events_waits_history =on # offperformance_schema_consumer_events_waits_history_long =off # offperformance-schema-instrument ='memory/%=COUNTED'
推荐阅读
-
-
-
-
美国法律专家怎么看TikTok起诉美政府?特朗普政府选择了审核程序政治化
-
专家|悬崖上发现多座楚王墓,崖顶上又发现多间寺庙,专家:两者关系可大了
-
-
-
心如温暖之夏|往往喜欢做3件事,福气越来越深厚,一个有福气的人
-
-
-
-
沃尔夫斯堡足球俱乐部|比如进她个100球?,下赛季定个小目标
-
苹果|“iPhone 13”遭国内厂商提前发售:小刘海、侧边指纹 只卖599!
-
|与吴君如弟弟离婚6年!江美仪与前婆家人聚会,相处融洽不尴尬
-
影院|黑龙江发布公告:非必要不离哈!感染者曾连续三天玩剧本杀
-
DNF|DNF:2天翻2张金牌!希洛克金牌率提升,欧皇非酋差距更大了
-
产业气象站■支付宝季度三连涨继续领跑整个行业,外媒:中国移动支付全球领先
-
苏东坡|古有苏东坡,今有郭沫若:郭沫若为什么自称比苏轼牛,他配吗?
-
3DMGAMETB《糖豆人:终极淘汰赛》宣传片演示60人撕逼大战
-
聚成教育|Excel表格技巧—如何根据单元格大小自动调整文字大小