系统是centos,内存只有512M,刚安装好一直不能启动服务,后来修改为 innodb_buffer_pool_size = 10M,便可以启动成功了,但是还是会占400M多,这样我连启动其他软件的内存都没有了,而且机器会比较慢,下面是我my.cnf的配置:
mysql版本是MySQL-server-5.6.16-1.rhel5.x86_64.rpm
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
[mysqld]
#Remove leading # and set to the amount of RAM for the most important data
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.
innodb_buffer_pool_size = 10M
# Remove leading # to turn on a very important data integrity option: logging
# changes to the binary log between backups.
# log_bin
# These are commonly set, remove the # and set as required.
# basedir = .....
# datadir = .....
# port = .....
# server_id = .....
# socket = .....
# Remove leading # to set options mainly useful for reporting servers.
# The server defaults are faster for transactions and fast SELECTs.
# Adjust sizes as needed, experiment to find the optimal value.
join_buffer_size =256k
key_buffer_size = 24M
sort_buffer_size = 512k
read_rnd_buffer_size = 2M
thread_cache_size = 10
query_cache_size = 1M
query_cache_limit = 2M
query_cache_min_res_unit = 4K
sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES
小弟初接触linux,求大神指点,怎么配置能降低内存? 感激不尽~
搞定了,mysql5.6 和 mysql 5.5默认配置不一样,在my.cnf文件中加入
performance_schema_max_table_instances=600
table_definition_cache=400
table_open_cache=256
即可