MYSQL-MARIADB the configuration used in practice (continuous improvement)

Source: Internet
Author: User

#基本配置

port=3306

Pid-file=/mnt/mysql/data/mysql.pid

Socket=/tmp/mysql.sock

Datadir=/data/mysql/data

Character_set_server=utf8

Default_storage_engine=innodb

#日志相关的配置

Log_error=/mnt/mysql/data/err.log

Slow_query_log=on

Slow_query_log_file=/mnt/mysql/data/slow.log

Long_query_time=1

Bin_log=mysql-bin

Binlog_format=statement

expire_logs_days=7#设置二进制日志保留的时间

#主从场景从库相关配置

Log_slave_updates#在从库开启二进制日志

Relay-log=relay-bin

Skip_slave_start#重启mysql后, replication does not start automatically

Relay-log-purge#重放完中继日志后将此中继日志删除

Read_Only#设置从库为只读, in addition to root and SQL replication threads

#优化相关的配置

max_allow_packet=1g

Innodb_file_per_table=1


This article is from the "burning Years of Passion" blog, please be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1881278

MYSQL-MARIADB the configuration used in practice (continuous improvement)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.