-
-
Save dinghao2020/9d5024cbab2c4663a21bbeec933c93cb to your computer and use it in GitHub Desktop.
my.cnf for mysql.server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mysqld] | |
socket=/tmp/mysql.sock | |
bind-address = 127.0.0.1 | |
port=13306 | |
user=root | |
#[mysqld_safe] | |
#socket=/usr/tmp/mysql.sock | |
#pid-file=/usr/local/var/mysql/mysql.pid | |
#log-error=/usr/local/var/log/mysql.log | |
[client] | |
socket=/tmp/mysql.sock | |
port=13306 | |
user=root | |
loose-default-character-set = utf8mb4 | |
[mysqld] | |
symbolic-links=0 | |
skip_name_resolve | |
default_storage_engine = InnoDB | |
transaction_isolation = READ-COMMITTED | |
## log | |
general_log=1 | |
general_log_file=/usr/local/var/log/mysql/mysql.log | |
log_error = /usr/local/var/log/mysql/error.log | |
## slow query log | |
slow_query_log | |
slow_query_log_file = /usr/local/var/log/mysql/slow.log | |
#long_query_time = 0.0 | |
## network | |
max_allowed_packet = 16M | |
max_connections = 1000 | |
max_connect_errors = 10000 | |
## cache size | |
table_open_cache = 2000 | |
thread_cache_size = 100 | |
query_cache_type = 1 | |
query_cache_size=1024M | |
binlog_cache_size = 16M | |
max_heap_table_size = 64M | |
tmp_table_size = 64M | |
## innodb | |
innodb_buffer_pool_size = 500M | |
innodb_data_file_path = ibdata1:10M:autoextend | |
innodb_log_buffer_size = 16M | |
innodb_log_file_size = 512M | |
innodb_doublewrite = 0 | |
innodb_lock_wait_timeout = 5 | |
innodb_support_xa = 1 | |
innodb_flush_log_at_trx_commit = 2 | |
innodb_flush_method = O_DIRECT | |
innodb_file_per_table | |
innodb_file_format = Barracuda | |
innodb_io_capacity=2000 | |
innodb_io_capacity_max=4000 | |
# その他 | |
character-set-server=utf8mb4 | |
[mysqld-5.6] | |
innodb_buffer_pool_dump_at_shutdown = 1 | |
innodb_buffer_pool_load_at_startup = 1 | |
innodb_flush_neighbors = 0 # For SSD. | |
innodb_random_read_ahead = false # For SSD. | |
innodb_read_ahead_threshold = 0 # For SSD. | |
[mysqld-5.7] | |
innodb_buffer_pool_dump_at_shutdown = 1 | |
innodb_buffer_pool_load_at_startup = 1 | |
innodb_flush_neighbors = 0 # For SSD. | |
innodb_random_read_ahead = false # For SSD. | |
innodb_read_ahead_threshold = 0 # For SSD. | |
sync_binlog = 0 | |
sync_relay_log = 0 | |
innodb_buffer_pool_dump_pct = 100 | |
log_queries_not_using_indexes | |
log_throttle_queries_not_using_indexes = 1 | |
character-set-server = utf8mb4 | |
collation-server = utf8mb4_bin |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment