新手linux 下mysql内存占用过高

MySql 码拜 9年前 (2015-11-26) 1563次浏览
系统是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,求高手指点,怎么配置能降低内存? 感激不尽~
解决方案:40分
以下是5.6默认的设置,会占用至少400M的内存
performance_schema_max_table_instances 12500
table_definition_cache 1400
table_open_cache 2000
所以你要调小这3个参数

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明新手linux 下mysql内存占用过高
喜欢 (0)
[1034331897@qq.com]
分享 (0)