Skip to content

Instantly share code, notes, and snippets.

@muhfaris
Last active July 29, 2016 02:34
Show Gist options
  • Save muhfaris/fce505c0af4db9ef1e8bb365cf455133 to your computer and use it in GitHub Desktop.
Save muhfaris/fce505c0af4db9ef1e8bb365cf455133 to your computer and use it in GitHub Desktop.
mysql my.cnf - VPS Ram 1gb swap 1gb
[mysql]
# CLIENT #
port = 3306
socket = /var/lib/mysql/mysql.sock
[mysqld]
# GENERAL #
user = mysql
default-storage-engine = InnoDB
socket = /var/lib/mysql/mysql.sock
pid-file = /var/lib/mysql/mysql.pid
performance_schema = off
# 300 n 300 #
interactive_timeout = 100
wait_timeout = 30
# MyISAM #
key-buffer-size = 204M
myisam-recover = FORCE,BACKUP
# SAFETY #
max-allowed-packet = 16M
max-connect-errors = 10
skip-name-resolve
sysdate-is-now = 1
innodb = FORCE
# DATA STORAGE #
datadir = /var/lib/mysql/
# BINARY LOGGING #
#log-bin = /var/lib/mysql/mysql-bin
expire-logs-days = 7
sync-binlog = 1
# CACHES AND LIMITS #
tmp-table-size = 200M
max-heap-table-size = 200M
query-cache-type = 0
query-cache-size = 0
max-connections = 64
thread-cache-size = 16
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 4096
# INNODB #
innodb-flush-method = O_DIRECT
#innodb-log-files-in-group = 2
innodb-log-file-size = 64M
innodb-flush-log-at-trx-commit = 2
innodb-file-per-table = 1
innodb-buffer-pool-size = 0
innodb_buffer_pool_instances = 1
# LOGGING #
log-error = /var/lib/mysql/mysql-error.log
log-queries-not-using-indexes = 1
slow-query-log = 1
slow-query-log-file = /var/lib/mysql/mysql-slow.log
max_allowed_packet=268435456
open_files_limit=10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment