windows:my.ini

[mysqld]

# Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
# innodb_buffer_pool_size = 128M # Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin # These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = ..... basedir = D:\\MySQL5.6
datadir = D:\MySQL5.6\\data
max_connections = 1100
max_user_connections = 1000
max_connect_errors = 10000
max_allowed_packet = 128M # Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal values.
# join_buffer_size = 128M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES skip_name_resolve = 1
skip_external_locking = 1
lower_case_table_names = 1
# logs
long_query_time = 1
slow_query_log = 1
slow_query_log_file = D:\\MySQL5.6\\logs\\slow.log
log_error = D:\\MySQL5.6\\logs\\error.log
#innodb_force_recovery=1
# binlog
binlog_format = row
log_bin = D:\\MySQL5.6\\logs\\mysql-bin
binlog_cache_size = 8M
max_binlog_size = 1G
max_binlog_cache_size = 4G
expire_logs_days = 5
log_bin_trust_function_creators = 1 ############ myisam
key_buffer_size = 64M
#bulk_insert_buffer_size = 32M
########## PGA
sort_buffer_size = 8M
read_buffer_size = 8M
join_buffer_size = 32M
read_rnd_buffer_size = 32M
query_cache_type = 0
query_cache_size = 0M
table_open_cache = 6144
table_definition_cache = 4096
open_files_limit = 65536
back_log = 512 thread_cache_size = 64
thread_stack=192k
tmp_table_size=128M
max_heap_table_size=128M transaction_isolation = READ-COMMITTED
innodb_data_home_dir = D:\MySQL5.6\\data
innodb_log_group_home_dir = D:\MySQL5.6\\data
innodb_data_file_path = ibdata1:12M:autoextend
innodb_buffer_pool_size = 1G
innodb_buffer_pool_instances = 8
innodb_log_file_size = 1024M
innodb_log_buffer_size = 64M
innodb_log_files_in_group = 3
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 10
innodb_sync_spin_loops = 40
innodb_max_dirty_pages_pct = 80
innodb_thread_concurrency = 0
innodb_thread_sleep_delay = 500
innodb_concurrency_tickets = 1000
innodb_file_per_table = 1
innodb_read_io_threads = 20
innodb_write_io_threads = 20
innodb_io_capacity = 600
innodb_file_format = Barracuda
innodb_purge_threads=1
innodb_purge_batch_size = 32
innodb_old_blocks_pct=50
innodb_stats_on_metadata=0 optimizer_switch='mrr=on,mrr_cost_based=off,batched_key_access=on' [myisamchk]
key_buffer_size = 64M
sort_buffer_size = 512k
read_buffer = 2M
write_buffer = 2M [mysqldump]
quick
max_allowed_packet = 128M
#myisam_max_sort_file_size = 10G [mysql]
no-auto-rehash
max_allowed_packet = 128M
prompt = '(BI154)\u@\h [10.11.20.31]> '

linux :my.cnf

[mysql] 
prompt = [// aliyunzixun@xxx.com//h][//d]>//_ 
[mysqld] 
# basic settings # 
user = mysql 
sql_mode = "STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER"
autocommit = 1 
character_set_server=utf8mb4 
transaction_isolation = READ-COMMITTED 
explicit_defaults_for_timestamp = 1 
max_allowed_packet = 16777216 
event_scheduler = 1 
# connection # 
interactive_timeout = 1800 
wait_timeout = 1800 
lock_wait_timeout = 1800 
skip_name_resolve = 1 
max_connections = 512 
max_connect_errors = 1000000 
# table cache performance settings 
table_open_cache = 4096 
table_definition_cache = 4096 
table_open_cache_instances = 128 
# session memory settings # 
read_buffer_size = 16M 
read_rnd_buffer_size = 32M 
sort_buffer_size = 32M 
tmp_table_size = 64M 
join_buffer_size = 128M 
thread_cache_size = 64 
# log settings # 
log_error = error.log 
slow_query_log = 1 
slow_query_log_file = slow.log 
log_queries_not_using_indexes = 1 
log_slow_admin_statements = 1 
log_slow_slave_statements = 1 
log_throttle_queries_not_using_indexes = 10 
expire_logs_days = 90 
long_query_time = 2 
min_examined_row_limit = 100 
binlog-rows-query-log-events = 1 
log-bin-trust-function-creators = 1 
expire-logs-days = 90 
log-slave-updates = 1 
# innodb settings # 
innodb_page_size = 16384 
innodb_buffer_pool_size = 160G 
innodb_buffer_pool_instances = 16 
innodb_buffer_pool_load_at_startup = 1 
innodb_buffer_pool_dump_at_shutdown = 1 
innodb_lru_scan_depth = 4096 
innodb_lock_wait_timeout = 5 
innodb_io_capacity = 10000 
innodb_io_capacity_max = 20000 
innodb_flush_method = O_DIRECT 
innodb_file_format = Barracuda 
innodb_file_format_max = Barracuda 
innodb_undo_logs = 128 
innodb_undo_tablespaces = 3 
innodb_flush_neighbors = 0 
innodb_log_file_size = 17179869184 
innodb_log_files_in_group = 2 
innodb_log_buffer_size = 16777216 
innodb_purge_threads = 4 
innodb_large_prefix = 1 
innodb_thread_concurrency = 64 
innodb_print_all_deadlocks = 1 
innodb_strict_mode = 1 
innodb_sort_buffer_size = 67108864 
innodb_write_io_threads = 16 
innodb_read_io_threads = 16 
innodb_file_per_table = 1 
innodb_stats_persistent_sample_pages = 64 
innodb_autoinc_lock_mode = 2 
innodb_online_alter_log_max_size=1G 
innodb_open_files=4096 
# replication settings # 
master_info_repository = TABLE 
relay_log_info_repository = TABLE 
sync_binlog = 1 
gtid_mode = on 
enforce_gtid_consistency = 1 
log_slave_updates 
binlog_format = ROW 
binlog_rows_query_log_events = 1 
relay_log = relay.log 
relay_log_recovery = 1 
slave_skip_errors = ddl_exist_errors 
slave-rows-search-algorithms = 'INDEX_SCAN,HASH_SCAN' 
# semi sync replication settings # 
plugin_load = "validate_password.so;rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so" 
rpl_semi_sync_master_enabled = 1 
rpl_semi_sync_master_timeout = 3000 
rpl_semi_sync_slave_enabled = 1 
# password plugin # 
validate_password_policy=STRONG 
validate-password=FORCE_PLUS_PERMANENT 
[mysqld-5.6] 
# metalock performance settings 
metadata_locks_hash_instances=64 
[mysqld-5.7] 
# new innodb settings # 
loose_innodb_numa_interleave=1 
innodb_buffer_pool_dump_pct = 40 
innodb_page_cleaners = 16 
innodb_undo_log_truncate = 1 
innodb_max_undo_log_size = 2G 
innodb_purge_rseg_truncate_frequency = 128 
# new replication settings # 
slave-parallel-type = LOGICAL_CLOCK 
slave-parallel-workers = 16 
slave_preserve_commit_order=1 
slave_transaction_retries=128 
# other change settings # 
binlog_gtid_simple_recovery=1 
log_timestamps=system 
show_compatibility_56=on

通用 mysql配置的更多相关文章

  1. SpringMVC+Mybatis+MySQL配置Redis缓存

    SpringMVC+Mybatis+MySQL配置Redis缓存 1.准备环境: SpringMVC:spring-framework-4.3.5.RELEASE-dist Mybatis:3.4.2 ...

  2. LAMP第三部分php配置和mysql配置

    9. 配置防盗链http://www.lishiming.net/thread-71-1-1.html 防止别人的网站,放你网站图片的链接, 位置一般情况下在 /usr/local/apache/co ...

  3. linux下安装apache与php;Apache+PHP+MySQL配置攻略

    1.apache   在如下页面下载apache的for Linux 的源码包    http://www.apache.org/dist/httpd/;   存至/home/xx目录,xx是自建文件 ...

  4. MySQL 配置

    MySQL 配置 1.服务启动: (1)使用 service 启动:service mysqld start (2)使用 mysqld 脚本启动:/etc/inint.d/mysqld start ( ...

  5. mysql配置mysql-proxy读写分离

    MySQL配置读写分离 192.168.23.131与192.168.23.132两台服务器,131是主,132是从,131是读写,132是只读.myql-proxy的IP是192.168.23.13 ...

  6. mysql配置之skip-external-locking

    转载:http://www.kuqin.com/database/20120815/328905.html MySQL的配置文件my.cnf中默认存在一行skip-external-locking的参 ...

  7. MySQL配置

    一.登录MySQL 要登录到MySQL只需要使用如下命令. mysql -h localhost -u root -p localhost:IP地址: root:用户名: database:数据库名( ...

  8. hive 的mysql配置

    hive默认使用的是Derby数据库,Derby是一个嵌入式数据库,数据库一般创建在运行hive命令的目录,如果切换目录运行,则找不到数据库 hive mysql配置: 官网地址:https://cw ...

  9. 2016年5月19日php,mysql配置

    1.php配置 1. 配置disable_functiondisable_functions = eval,assert,popen,passthru,escapeshellarg,escapeshe ...

随机推荐

  1. "零代码”开发B/S企业管理软件之一 :怎么创建数据库表

    声明:该软件为本人原创作品,多年来一直在使用该软件做项目,软件本身也一直在改善,在增加新的功能.但一个人总是会有很多考虑不周全的地方,希望能找到做同类软件的同行一起探讨. 本人文笔不行,能把意思表达清 ...

  2. django之单表操作

    1.查询方法: <1> all(): 查询所有结果 <2> filter(**kwargs): 它包含了与所给筛选条件相匹配的对象 <3> get(**kwargs ...

  3. 我的Android进阶之旅------&gt;Android无第三方Jar包的源代报错:The current class path entry belongs to container ...的解决方法

    今天使用第三方Jar包afinal.jar时候.想看一下源码,无法看 然后像加入jar相应的源代码包.也无法加入相应的源代码,报错例如以下:The current class path entry b ...

  4. (转) latch 入门

    原链接:http://www.itpub.net/thread-1424719-1-1.html (入门1)一直想点文章关于Latch的,又一直没写,一是因为懒,二是一直觉得现在关于Latch的书那么 ...

  5. vue-router路由器的使用

    一. vue-router路由 1.简介 1.为什么要用vue-router 使用Vue.js开发SPA(Single Page Application)单页面应用 2.什么是单页面应用 根据不同ur ...

  6. knockout 学习使用笔记-----event绑定传参ko属性

    在绑定event的时候,需要传入ViewModal 本身的属性值(其实没必要,js直接能获取到,此处为测试相关参数的传递),如果不加(),会将绑定的function传进event(至于为嘛传了个fun ...

  7. ul,li设置inline-block缝隙

    去掉换行符和空白符 margin-left: -0.5em(缝隙大小不确定) ul字号设为0,li设置字号 (有些浏览器设置最小字体) js移除空白子节点

  8. s5_day9作业

    # 1 编写 tail -f a.txt |grep 'error' |grep '404'命令,周一默写 # import time # def tail(filepath,encoding='ut ...

  9. LeetCode:二叉树的后序遍历【145】

    LeetCode:二叉树的后序遍历[145] 题目描述 给定一个二叉树,返回它的 后序 遍历. 示例: 输入: [1,null,2,3] 1 \ 2 / 3 输出: [3,2,1] 进阶: 递归算法很 ...

  10. hadoop28---netty传对象

    Netty中,通讯的双方建立连接后,会把数据按照ByteBuf的方式进行传输,例如http协议中,就是通过HttpRequestDecoder对ByteBuf数据流进行处理,转换成http的对象.基于 ...