专注Java教育14年 全国咨询/投诉热线:444-1124-454
赢咖4LOGO图
始于2009,口口相传的Java黄埔军校
首页 hot资讯 MySQL配置文件详解

MySQL配置文件详解

更新时间:2022-03-21 10:38:19 来源:赢咖4 浏览1101次

MySQL配置文件详解

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install, and will be replaced if you
# *** upgrade to a newer version of MySQL.
# Suitable for 4G R0M configuration
[mysql]
#default-character-set = utf8mb4
[mysqld]
tmpdir=/data/tmp
lower_case_table_names = 1
ft_min_word_len = 1
character_set-server = utf8mb4
collation_server = utf8mb4_unicode_ci
net_read_timeout=3600
net_write_timeout=3600
innodb_file_per_table=1
max_allowed_packet = 300M

#ibdata1为innodb的共享表空间,用来存储文件的数据 ibdata2满后增加,约是ibdata1的1/10mys

innodb_data_file_path = ibdata1:3072M;ibdata2:307M:autoextend
skip-name-resolve
#skip-grant-tables
# 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
#  innodb_force_recovery = 6 
#  innodb_purge_thread = 0
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
max_connections = 1000
query_cache_size = 32M
query_cache_type = 1
query_cache_limit = 65536
innodb_ft_cache_size = 1000000
innodb_ft_result_cache_limit = 50000000
key_buffer_size = 524163
read_buffer_size = 8191
tmp_table_size=16M
max_heap_table_size=16M
slow-query-log=1
slow-query-log-file=/data/mysql/mysql-slow.log
long_query_time=1
wait_timeout=2880000
interactive_timeout=2880000
# 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 = .....
datadir = /data/mysql/data/
# port = .....
# server_id = .....
# socket = .....
# 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 

以上就是关于“MySQL配置文件详解”的介绍,大家如果对此比较感兴趣,想了解更多相关知识,不妨来关注一下赢咖4的Java赢咖4在线学习,里面的课程内容更加全面,从入门到精通都有,由浅到深,适合没有基础的朋友学习,希望对大家能够有所帮助。

提交申请后,顾问老师会电话与您沟通安排学习

免费课程推荐 >>
技术文档推荐 >>