新手linux 下mysql内存占用过高

邹知宇 2014-03-06 10:53:46
系统是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,求大神指点,怎么配置能降低内存? 感激不尽~
...全文
2320 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
dzhappy 2015-12-23
  • 打赏
  • 举报
回复
我的是1G内存,也是这个问题,看来是非逼着我升级到2G内存了。
Leson_Yin 2014-08-04
  • 打赏
  • 举报
回复
引用 4 楼 u012438569 的回复:
[quote=引用 2 楼 xtdhqdhq 的回复:] 以下是5.6默认的设置,会占用至少400M的内存。 performance_schema_max_table_instances 12500 table_definition_cache 1400 table_open_cache 2000 所以你要调小这3个参数
太给力了,就是这个原因,要是我早点看到就好了,虽然我中午已经解决了,不过还是很感谢你,分都给你啦![/quote] 请问楼主是如何 配置的?
Leson_Yin 2014-08-04
  • 打赏
  • 举报
回复
引用 2 楼 xtdhqdhq 的回复:
以下是5.6默认的设置,会占用至少400M的内存。 performance_schema_max_table_instances 12500 table_definition_cache 1400 table_open_cache 2000 所以你要调小这3个参数
调小了,不起作用?不知道 楼主是怎么配置的?
邹知宇 2014-03-06
  • 打赏
  • 举报
回复
引用 2 楼 xtdhqdhq 的回复:
以下是5.6默认的设置,会占用至少400M的内存。 performance_schema_max_table_instances 12500 table_definition_cache 1400 table_open_cache 2000 所以你要调小这3个参数
太给力了,就是这个原因,要是我早点看到就好了,虽然我中午已经解决了,不过还是很感谢你,分都给你啦!
rucypli 2014-03-06
  • 打赏
  • 举报
回复
换个低版本的mysql把
果儿妈 2014-03-06
  • 打赏
  • 举报
回复
以下是5.6默认的设置,会占用至少400M的内存。 performance_schema_max_table_instances 12500 table_definition_cache 1400 table_open_cache 2000 所以你要调小这3个参数
Rotel-刘志东 2014-03-06
  • 打赏
  • 举报
回复
硬件环境比较差,最好更换新硬件环境。 512内存一定会存在瓶颈的。

56,803

社区成员

发帖
与我相关
我的任务
社区描述
MySQL相关内容讨论专区
社区管理员
  • MySQL
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧