通用 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 ...
随机推荐
- myeclipse部署web项目部署按钮无效
找到MyEclipse的工作路径,我的是“E:\Java”,到这个目录中去“\.metadata\.plugins\org.eclipse.core.runtime\.settings”找一个含有de ...
- Selenium 安装与卸载
安装: 在cmd中键入pip install selenium==3.6.0(等号后面的为版本号),并点击回车,当出现Successfully installed selenium-3.6.0即表示已 ...
- AngularJs使用过程中,在ng-repeat中使用track by
1.问题描述: 点击删除后:table中的被选中设备确实被删除了,但是data-table并没有重新加载出来, 查看js代码: 先对$scope.data_table进行了destroy(),然后重新 ...
- EJB远程客户端和本地客户端
在客户端中使用企业bean 企业bean的客户端通过依赖注入或JNDI查询的方式获得对企业bean实例的引用. 依赖注入是获得对企业bean实例的引用的最简便的方法. (紧耦合的bean之间相互依赖, ...
- Q35+uefi or bios+legacy // PCI | PCIE
1:首先统一可扩展固件接口(UEFI)是一种规范定义操作系统和平台固件之间的软件接口. UEFI旨在替代基本输入/输出系统(BIOS)固件接口.(legacy) 硬件平台厂商越来越多地采用UEFI管理 ...
- React官网首页demo(单文件实现版)
本博客实现React官网首页上展示的demo, 为了方便直接采用单文件的形式, 如果想完整集成 在自己的项目中, 可以参考React官网的安装指南, 安装Create React App. hello ...
- Python 优雅的操作字典
Python 中的字典是Python中一个键值映射的数据结构,下面介绍一下如何优雅的操作字典. 来源:https://www.linuxzen.com/python-you-ya-de-cao-zuo ...
- ORM实例介绍
http://blog.csdn.net/RonoTian/article/details/2900714
- PHP memcache扩展模块安装
安装php扩展模块memcache memcache 的工作就是在专门的机器的内存里维护一张巨大的hash表,来存储经常被读写的一些数组与文件,从而极大的提高网站的运行效率,减轻后端数据库的读写压力. ...
- D3学习之动画和变换
D3学习之动画和变换 ##(17.02.27-02.28) 主要学习到了D3对动画和缓动函数的一些应用,结合前面的选择器.监听事件.自定义插值器等,拓展了动画的效果和样式. 主要内容 单元素动画 多元 ...