低配置服务器Mysql内存调优

服务器配置情况如下,




进入  vim /etc/my.cnf 或者mysql.cnf 

[mysqld]
datadir=/usr/local/mysql/data
socket=/usr/local/mysql/data/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

innodb_buffer_pool_size = 64 # (adjust value here, 50%-70% of total RAM)
innodb_log_file_size = 18M
innodb_flush_log_at_trx_commit = 0 # may change to 2 or 0
innodb_flush_method = O_DIRECT
performance_schema_max_table_instances=200
table_definition_cache=200
table_open_cache=128

[mysqld_safe]
log-error=/usr/local/mysql/data/mysqld.log
pid-file=/usr/local/mysql/data/mysqld.pid
log_error=/usr/local/mysql/data/error.log

猜你喜欢

转载自blog.csdn.net/zl834205311/article/details/79569367