linux mysql 5.6 内存过大的问题

版权声明:转载请注明出处 https://blog.csdn.net/u010659887/article/details/82498913

在linux上安装5.6版本的mysql后,发现内存达到700M,经过一番上网查找发现下面的设置可以减少内存:

[mysqld]
performance_schema_max_table_instances=400         
table_definition_cache=400                         
table_open_cache=256 

重启mysql后内存减少到380m,虽然依然很大,也勉强可以使用了。

随后继续查资料发现其实mysql的安装目录share下就有各种不同需求的my.cnf配置,直接copy过来改名my.cnf就可以使用了

my-huge.cnf
This is for a large system with memory of 1G-2G where the system runs mainly.

my-innodb-heavy-4G.cnf
#DESCR: 4GB RAM, InnoDB only, ACID, few connections, heavy queries.

my-large.cnf
This is for a large system with memory = 512M where the system runs mainly.

my-medium.cnf
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)

my-small.cnf
# This is for a system with little memory (<= 64M) where MySQL is only used
# from time to time and it's important that the mysqld daemon
# doesn't use much resources.

我在之前的基础上又使用了my-small.cnf的配置,内存降到350M,没有到注释的64M,估计安装过程某一步的问题。

猜你喜欢

转载自blog.csdn.net/u010659887/article/details/82498913