/
my.cnf
123 lines (118 loc) · 5.83 KB
/
my.cnf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
!include /etc/mysql/credentials.cnf
# 2020-09-28
# «The [client] option group is read by all client programs provided in MySQL distributions (but not by mysqld).
# The [client] group enables you to specify options that apply to all clients.
# For example, [client] is the appropriate group to use to specify the password for connecting to the server.
# Be sure not to put an option in the [client] group unless it is recognized by all client programs that you use.
# Programs that do not understand the option quit after displaying an error message if you try to run them.»
# https://dev.mysql.com/doc/refman/5.7/en/option-files.html
[client]
host = localhost
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysql]
no-beep
default-character-set=utf8
# 2024-02-09
# 1) "Disable the «automatic rehashing» feature of `mysql`": https://github.com/dmitrii-fediuk/5.9.188.84/issues/58
# 2) https://dev.mysql.com/doc/refman/8.0/en/mysql-command-options.html#option_mysql_auto-rehash
skip-auto-rehash
[mysqld]
# 2017-04-30 «The path to the MySQL installation directory».
# https://dev.mysql.com/doc/refman/5.7/en/mysql-server.html#option_mysql_server_basedir
# https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_basedir
# Не знаю, надо ли указывать эту опцию.
# Она присутствовала в моём предыдущем файле настроек, но отсутствует в стандартном файле настроек MySQL 5.7.18
basedir = /usr
# 2020-09-28 https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_bind_address
bind-address = 127.0.0.1
datadir = /var/lib/mysql
default-storage-engine = INNODB
# 2017-05-18
# «The number of days for automatic binary log file removal.
# The default is 0, which means “no automatic removal.”
# Possible removals happen at startup and when the binary log is flushed».
; https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_expire_logs_days
expire_logs_days = 10
# 2017-04-29 It removes the warning «TIMESTAMP with implicit DEFAULT value is deprecated»: https://df.tips/t/185
explicit_defaults_for_timestamp = 1
# 2017-04-30 Важно! Чтобы Magento искала по двубуквенным запросам.
ft_min_word_len = 2
# 2017-04-30 https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_buffer_pool_size
innodb_buffer_pool_size = 4000M
# 2017-04-30 https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_checksum_algorithm
innodb_checksum_algorithm = crc32
# 2017-04-30 https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_fast_shutdown
innodb_fast_shutdown = 1
# 2017-04-30 https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_flush_log_at_trx_commit
# 2020-05-26
# «With a setting of 2, logs are written after each transaction commit and flushed to disk once per second.
# Transactions for which logs have not been flushed can be lost in a crash.»
innodb_flush_log_at_trx_commit = 2
innodb_log_file_size = 125M
key_buffer_size = 384M
lc-messages-dir = /usr/share/mysql
log_error = /var/log/_my/mysql.log
# 2017-04-30
# «This variable controls verbosity of the server in writing error, warning, and note messages to the error log.
# The following table shows the permitted values. The default is 3.
# 1 Errors only
# 2 Errors and warnings
# 3 Errors, warnings, and notes»
# https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_log_error_verbosity
# 2020-12-23 MariaDB does not support this option: https://mariadb.com/kb/en/error-log/#mysqls-log_error_verbosity
log_error_verbosity = 2
log-output = NONE
max_allowed_packet = 256M
max_binlog_size = 100M
max_connections = 700
# 2017-04-30 https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_myisam_max_sort_file_size
myisam_max_sort_file_size = 100G
myisam_sort_buffer_size = 214M
pid-file = /var/run/mysqld/mysqld.pid
port = 3306
query_cache_size = 200M
read_buffer_size = 1M
read_rnd_buffer_size = 768K
# 2017-05-19
# «It suppresses the The 'INFORMATION_SCHEMA.GLOBAL_STATUS' feature is disabled;
# see the documentation for 'show_compatibility_56'» Backupninja issue:
# https://mail.google.com/mail/u/0/#inbox/15c1ba6ad17205cf
# https://i-mscp.net/index.php/Thread/13361-MySQL-5-7-show-compatibility-56/?postID=45190#post45190
# 2018-03-03
# "How to fix «The 'INFORMATION_SCHEMA.SESSION_VARIABLES' feature is disabled» in MySQL 5.7?"
# https://df.tips/t/513
# https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_show_compatibility_56
show_compatibility_56 = On
skip-external-locking
socket = /var/run/mysqld/mysqld.sock
sort_buffer_size = 4M
# 2017-04-30 https://df.tips/t/186
# 2018-07-31
# "How to fix the «Invalid default value for 'updated_at'» MySQL 5.7 failire?" https://mage2.pro/t/5629
# 2019-07-21
# In the previous change (last year) I have removed the `NO_ZERO_DATE` option.
# It led to the warning: «'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql modes
# should be used with strict mode. They will be merged with strict mode in a future release.»
# So I have restored the `NO_ZERO_DATE` option.
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO"
# 2017-04-30
# How to remove the «SSL context is not usable without certificate and private key» warning for a localhost-only MySQL server?
# https://df.tips/t/191
ssl = 0
# 2017-04-30 https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_table_definition_cache
table_definition_cache = 20000
table_open_cache = 20000
thread_cache_size = 34
thread_stack = 192K
tmp_table_size = 112M
tmpdir = /tmp
user = mysql
[mysqld_safe]
nice = 0
open-files-limit = 20000
socket = /var/run/mysqld/mysqld.sock
[mysqldump]
quick
quote-names
max_allowed_packet = 256M