官方提供的优化数据 [mysqld]
# GENERAL # user = mysql default-storage-engine = InnoDB #socket = /var/lib/mysql/mysql.sock #pid-file = /var/lib/mysql/mysqld.pid
# MyISAM # # key-buffer-size = 32M # myisam-recover = FORCE,BACKUP
# SAFETY # max-allowed-packet = 16M max-connect-errors = 1000000 sql-mode = NO_ENGINE_SUBSTITUTION,NO_AUTO_CREATE_USER sysdate-is-now = 1 innodb-strict-mode = 1
# DATA STORAGE # datadir = /var/lib/mysql
# SERVER ID # server-id = 677161
# CACHES AND LIMITS # max-connections = 500 tmp-table-size = 32M max-heap-table-size = 32M query-cache-type = 0 query-cache-size = 0 thread-cache-size = 50 open-files-limit = 65535 table-definition-cache = 1024 table-open-cache = 2048
# INNODB # innodb-flush-method = O_DIRECT innodb-log-files-in-group = 2 innodb-log-file-size = 128M innodb-flush-log-at-trx-commit = 1 innodb-file-per-table = 1 innodb-buffer-pool-size = 1228M
# LOGGING # log-error = /var/lib/mysql/mysqld.log slow-query-log = 1 slow-query-log-file = /var/lib/mysql/mysqld-slow.log log-queries-not-using-indexes = OFF long_query_time = 30
[mysqldump] max-allowed-packet = 16M
!includedir /etc/mysql/conf.d/ !includedir /etc/mysql/mariadb.conf.d/ |