通用 mysql配置
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配置的更多相关文章
- SpringMVC+Mybatis+MySQL配置Redis缓存
SpringMVC+Mybatis+MySQL配置Redis缓存 1.准备环境: SpringMVC:spring-framework-4.3.5.RELEASE-dist Mybatis:3.4.2 ...
- LAMP第三部分php配置和mysql配置
9. 配置防盗链http://www.lishiming.net/thread-71-1-1.html 防止别人的网站,放你网站图片的链接, 位置一般情况下在 /usr/local/apache/co ...
- linux下安装apache与php;Apache+PHP+MySQL配置攻略
1.apache 在如下页面下载apache的for Linux 的源码包 http://www.apache.org/dist/httpd/; 存至/home/xx目录,xx是自建文件 ...
- MySQL 配置
MySQL 配置 1.服务启动: (1)使用 service 启动:service mysqld start (2)使用 mysqld 脚本启动:/etc/inint.d/mysqld start ( ...
- mysql配置mysql-proxy读写分离
MySQL配置读写分离 192.168.23.131与192.168.23.132两台服务器,131是主,132是从,131是读写,132是只读.myql-proxy的IP是192.168.23.13 ...
- mysql配置之skip-external-locking
转载:http://www.kuqin.com/database/20120815/328905.html MySQL的配置文件my.cnf中默认存在一行skip-external-locking的参 ...
- MySQL配置
一.登录MySQL 要登录到MySQL只需要使用如下命令. mysql -h localhost -u root -p localhost:IP地址: root:用户名: database:数据库名( ...
- hive 的mysql配置
hive默认使用的是Derby数据库,Derby是一个嵌入式数据库,数据库一般创建在运行hive命令的目录,如果切换目录运行,则找不到数据库 hive mysql配置: 官网地址:https://cw ...
- 2016年5月19日php,mysql配置
1.php配置 1. 配置disable_functiondisable_functions = eval,assert,popen,passthru,escapeshellarg,escapeshe ...
随机推荐
- IIS设置文件 Robots.txt 禁止爬虫
robots.txt用于禁止网络爬虫访问网站指定目录.robots.txt的格式采用面向行的语法:空行.注释行(以#打头).规则行.规则行的格式为:Field: value.常见的规则行:User-A ...
- Android主页导航:fragment+viewpager
简单实现Fragment+ViewPager实现主页导航控制,效果如下: 一.activity_main.xml布局文件: <?xml version="1.0" encod ...
- 利用VMware克隆linux虚拟机需要注意的事项
利用VMware克隆虚拟机需要注意的问题 2018年03月30日 18:20:29 温文尔雅的流氓 阅读数:1343更多 个人分类: linux 版权声明:本文为博主原创文章,未经博主允许不得转载 ...
- SQL逻辑查询语句 执行顺序 语法顺序
SELECT语句语法顺序 SELECT DISTINCT <select_list> FROM <left_table> <join_type> JOIN < ...
- [DevOps] 认识一下
大家都在说DevOps(Develop Operation),大概知道就是开发和运维沟通交流,一条线,然后使产品能够顺利的.短时间内上线.维稳什么的. 今天特意看了下 DockOne里面的一篇文章,再 ...
- MySQL 多表查询(Day43)
阅读目录 一,介绍 二,多表连接查询 三,符合条件链接查询 四,子查询 五,综合练习 ========================================================= ...
- 数据结构&算法(二)_算法基础之前传(递归、时间复杂度、空间复杂度、二分查找)
什么是算法: 间而言之算法(Algorithm):一个计算过程,解决问题的方法 递归的两个特点: 调用自身 结束条件 递归示例: def func(x): : print("我的小鲤鱼&qu ...
- CNN学习笔记:池化层
CNN学习笔记:池化层 池化 池化(Pooling)是卷积神经网络中另一个重要的概念,它实际上是一种形式的降采样.有多种不同形式的非线性池化函数,而其中“最大池化(Max pooling)”是最为常见 ...
- freemarker split字符串分割 遍历map
<#list "张三三,李思思,,王强,柳树,诸葛正我"?split(",") as name> "${name}" </ ...
- js高级---js架构
ECMAScript1997 年欧洲计算机制造商协会 39 号技术委员会制定了ECMA-262标准(别名 ECMAScript),而浏览器只是负责实现,ie浏览器实现的结果是jscript,远景浏览器 ...