MySQL常用配置

0

[client]
port                    = 3306
socket                  = /tmp/mysql.sock
default-character-set   = utf8mb4

[mysql]
no-auto-rehash
default-character-set   = utf8mb4

[mysqld]
port                    = 3306
user                    = mysql
socket                  = /tmp/mysql.sock
# 安装目录:可以忽略
basedir                 = /usr/local/mysql-5.7.26
# 数据目录:初始化后不能修改
datadir                 = /home/mysql/data
server-id               = 1
bind-address            = 0.0.0.0
log-bin                 = mysql-bin
binlog_format           = mixed
collation-server        = utf8mb4_general_ci
character-set-server    = utf8mb4
lower_case_table_names  = 1
max_connections         = 512
key_buffer_size         = 16M
table_open_cache        = 128
sort_buffer_size        = 2M
read_buffer_size        = 2M
net_buffer_length       = 16K
max_allowed_packet      = 2M
read_rnd_buffer_size    = 2M
default-storage-engine  = INNODB
myisam_sort_buffer_size = 8M
innodb_buffer_pool_size = 8M

[mysqldump]
quick
max_allowed_packet      = 16M