mysql 5.7 my.cnf配置
此为配置上生产环境的参数,后续补充参数说明
[client]
port=3306
socket = /data/mysql/tmp/mysql.sock
# default-character-set=utf8
[mysqld]
datadir = /data/mysql/data
basedir = /usr
socket = /data/mysql/tmp/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
user = mysql
character-set-server=utf8
user = mysql
tmpdir = /data/mysql/tmp
transaction_isolation = READ-COMMITTED
default-storage-engine = InnoDB
explicit_defaults_for_timestamp = 1
lower_case_table_names = 1
event_scheduler = 1
skip-external-locking
sql_mode = 'NO_AUTO_VALUE_ON_ZERO,STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,PIPES_AS_CONCAT,ANSI_QUOTES'
plugin_dir = /usr/lib64/mysql/plugin
# ---------------- Connection/File/Table ----------------
interactive_timeout = 1800
wait_timeout = 1800
lock_wait_timeout = 1800
skip_name_resolve = 1
max_connections = 1000
max_user_connections = 256
max_connect_errors = 20000
back_log = 384
open_files_limit = 65535
table_open_cache = 1024
table_definition_cache = 1024
table_open_cache_instances = 32
# ---------------- Session Buffer Cache ----------------
query_cache_size = 0
query_cache_type = 0
max_allowed_packet = 64M
read_buffer_size = 16M
read_rnd_buffer_size = 16M
sort_buffer_size = 16M
tmp_table_size = 64M
join_buffer_size = 32M
key_buffer_size = 384M
thread_cache_size = 64
thread_stack = 256K
# ---------------- Logfile ----------------
slow_query_log = 1
slow_query_log_file = /data/mysql/log/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
min_examined_row_limit = 100
binlog-rows-query-log-events = 1
log-bin-trust-function-creators = 1
long_query_time = 0.1
# ---------------- Binlog ----------------
log-bin = /data/mysql/log/binlog/mysql-bin
#log-bin-index = /data/mysql/log/binlog/mysql-bin.index
binlog_format = row
expire_logs_days = 7
sync_binlog = 1
binlog_cache_size = 8M
max_binlog_cache_size = 2048M
max_binlog_size = 1024M
binlog_rows_query_log_events = 1
# ---------------- InnoDB ----------------
innodb_buffer_pool_size = 1G
innodb_buffer_pool_instances = 1
innodb_online_alter_log_max_size = 1024M
innodb_thread_concurrency = 8
innodb_io_capacity = 4000
innodb_io_capacity_max = 8000
innodb_sort_buffer_size = 64M
innodb_page_size = 16K
innodb_open_files = 1024
innodb_flush_log_at_trx_commit = 1
innodb_read_io_threads = 8
innodb_write_io_threads = 8
innodb_purge_threads = 4
innodb_max_dirty_pages_pct = 80
innodb_buffer_pool_load_at_startup = 1
innodb_buffer_pool_dump_at_shutdown = 1
innodb_lock_wait_timeout = 30
innodb_rollback_on_timeout = 1
innodb_lru_scan_depth = 1024
innodb_flush_method = O_DIRECT
innodb_checksum_algorithm = CRC32
innodb_file_per_table = 1
innodb_file_format = Barracuda
innodb_file_format_max = Barracuda
innodb_flush_neighbors = 0
innodb_large_prefix = 0
innodb_print_all_deadlocks = 1
innodb_stats_persistent_sample_pages = 64
innodb_autoinc_lock_mode = 2
innodb_sync_spin_loops = 100
innodb_spin_wait_delay = 30
innodb_stats_on_metadata = 0
# ---------------- Redo/Undo ----------------
innodb_log_buffer_size = 16M
innodb_log_file_size = 1024M
innodb_log_files_in_group = 3
innodb_log_group_home_dir = /data/mysql/log/redo
innodb_undo_logs = 128
innodb_undo_tablespaces = 3
innodb_undo_directory = /data/mysql/log/undo
# ---------------- Replication ----------------
server-id = 101
master_info_repository = TABLE
relay_log_info_repository = TABLE
gtid_mode = on
enforce_gtid_consistency = 1
log_slave_updates = 1
relay_log = /data/mysql/log/relay/relay.log
relay_log_recovery = 1
slave_skip_errors = ddl_exist_errors
slave-rows-search-algorithms = 'INDEX_SCAN,HASH_SCAN'
# ---------------- perforamnce_schema ----------------
performance-schema-instrument = 'memory/%=COUNTED'
performance_schema_digests_size = 40000
performance_schema_max_table_instances = 40000
performance_schema_max_sql_text_length = 4096
performance_schema_max_digest_length = 4096
loose_innodb_numa_interleave = 1
innodb_buffer_pool_dump_pct = 75
innodb_page_cleaners = 4
innodb_undo_log_truncate = 1
innodb_max_undo_log_size = 2G
innodb_purge_rseg_truncate_frequency = 128
slave-parallel-type = LOGICAL_CLOCK
slave-parallel-workers = 16
slave_preserve_commit_order = 1
slave_transaction_retries = 128
binlog_gtid_simple_recovery = 1
log_timestamps = system
show_compatibility_56 = 1
[mysql]
no-auto-rehash
default-character-set=utf8
[mysqld_safe]
log-error = /data/mysql/log/error.log
pid-file = /data/mysql/tmp/mysql.pid
mysql 5.7 my.cnf配置的更多相关文章
- Linux MySQL 4G内存my.cnf配置表(转)
# The following options will be passed to all MySQL clients[client]character-set-server = utf8 #### ...
- MYSQL服务器my.cnf配置文档详解
MYSQL服务器my.cnf配置文档详解 硬件:内存16G [client] port = 3306 socket = /data/3306/mysql.sock [mysql] no-auto-re ...
- mysql my.cnf 配置建议
mysql的配置文件是/etc/my.cnf,通过修改它来配置mysql. /etc/my.cnf来自以下文件: 如果你的内存≤64M,则复制/usr/local/share/mysql/my-sma ...
- Mariadb/MySQL生产环境的my.cnf配置示例
Mariadb/MySQL生产环境的my.cnf配置示例 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.针对MySQL主程序mysqld定义参数[mysqld] 1>. ...
- mysql中binlog_format模式与配置详解
mysql复制主要有三种方式:基于SQL语句的复制(statement-based replication, SBR),基于行的复制(row-based replication, RBR),混合模式复 ...
- mysql 5.0.46安装配置
http://os.chinaunix.net/a2008/0801/986/000000986346.shtml RPM包和源码包存放位置 /usr/local/src 源码包编译安装位置(pref ...
- mysql中max_allowed_packet参数的配置方法(避免大数据写入或者更新失败)
修改方法 1.修改配置文件 可以编辑my.cnf来修改(windows下my.ini),在[mysqld]段或者mysql的server配置段进行修改. 代码如下: max_allowed_packe ...
- [转]MySQL5.5 my.cnf配置参考
主要配置参数转载自: http://www.linuxyw.com/a/shujuku/20130506/216.html 并稍微做了修改MyISAM部分以适应当前的环境 此配置是老男孩生产线上使用的 ...
- Mac 下 Nginx、MySQL、PHP-FPM 的安装配置
用了3年多的本本罢工,最近新入手了一台 rmbp,一堆工作环境要配置,LNMP 里的 NMP 是常规要安装的,恰好也是第一次在 mac 上安装配置 nginx.mysql.php,所以顺便做个记录,免 ...
随机推荐
- 查看已安装dpkg包的poinst安装文件
/var/lib/dpkg/info |grep printburn(软件名称) /var/lib/dpkg/info 文件都在这个目录下面poinst, preinst,prerm等
- [LeetCode] 529. Minesweeper 扫雷
Let's play the minesweeper game (Wikipedia, online game)! You are given a 2D char matrix representin ...
- 当代码上传git时,提示Repository not found The requested repository does not exist, or you do not have permission to access it. fatal: Could not read from remote repository. Please make sure you have the corre
1.检查当前git中设置的用户名与邮箱是否与自己电脑上的一致. 看这个文件中 如果不一致,只需要把里面的内容全部复制出来添加到git(看下图位置) 这是再执行:git push -u origin m ...
- Java面试题大汇总(附答案)
下列面试题都是在网上收集的,本人抱着学习的态度找了下参考答案,有不足的地方还请指正,更多精彩内容可以关注我的微信公众号:Java团长 相关概念 面向对象的三个特征 封装,继承,多态.这个应该是人人皆知 ...
- 删除Win10自动下载的更新安装包
当我们禁止了系统的自动更新后,会感觉还有什么东西没做,没错,你还没有删除系统自动下载好的安装包,如果不删除的话会白白浪费磁盘空间!那么系统自动下载的安装包在哪里呢? C盘Windows—Softwar ...
- VS2019/VS2017设置默认管理员权限启动
找到vs安装目录下的:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.exe 右键- ...
- 1206 雅礼集训D2题解
A \(two\) \(1.1\) \(Description\) 你有两棵有根树,每棵各有 n 个顶点.让我们用整数 1 到 n 给每棵树的顶点编 号.两棵树的根都是顶点 1.第一棵树的边都都是蓝色 ...
- 为什么k8s引入pod概念?
为什么k8s引入pod概念? 1.可管理性 有些容器天生需要紧密关联,以pod为最小单位进行调度 扩展 共享资源 管理生命周期 例如: 一个容器写日志,一个容器读取日志进行相关内容的展示 2.通信和资 ...
- POJ 1661 Help Jimmy(C)动态规划
没刷过 POJ,这题是论坛有人问的,我才看看. 我发现 POJ 注册很奇怪,账号总是登不上去,弄的我还注册两个.Emmm 首次体验很差,还好我不在 POJ 刷题. 题目链接:POJ 1661 Help ...
- 基于全志a33-vstar开发板的ap6210WiFi模块移植
可以去链接看更详细的,第一次用博客,这个编辑方式太不友好了. 文档:全志a33--系统移植--ap6210WiFi模块移?..链接:http://note.youdao.com/noteshare?i ...