这是用yum安装mariadb后在etc里的my.cnf文件的配置,其中bind-address很重要,因为这个东西折腾了好久


# 这个组同时被客户端和服务器读取
# 用于影响所有内容的选项


#
#[client-server]

#
# 包含配置目录中的所有 *.cnf 文件
# !includedir /etc/my.cnf.d

[client]
port = 3306
socket = /var/lib/mysql/mysql.sock

[mysqld]
port = 3306
socket = /var/lib/mysql/mysql.sock
datadir = /var/lib/mysql
log-error = /var/log/mariadb/mariadb.log
bind-address = 0.0.0.0 #pid-file = /var/run/mariadb/mariadb.pid

设置默认字符集和校对规则

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

设置默认存储引擎

default-storage-engine = InnoDB

设置默认事务隔离级别

transaction-isolation=READ-COMMITTED

设置默认二进制日志格式和位置

binlog_format=ROW
log-bin=/var/lib/mysql/mysql-bin

Set the default max_allowed_packet size

max_allowed_packet=64M

Set the default innodb_buffer_pool_size

innodb_buffer_pool_size=128M

Set the default innodb_log_file_size

innodb_log_file_size=64M

Set the default innodb_flush_log_at_trx_commit

innodb_flush_log_at_trx_commit=1

Set the default innodb_file_per_table

innodb_file_per_table=1


扫描二维码,在手机上阅读!

发表评论

电子邮件地址不会被公开。 必填项已用*标注