centos mysql5.6 内存过大

安装完后发现,内存和虚拟内存占用都很大。
我的vps总共才1G内存,不需要mysql那么大的内存。

1、关闭innodb使用MYISAM存储引擎
参考http://docs.oracle.com/cd/E17952_01/refman-5.6-en/innodb-turning-off.html

2、添加配置
performance_schema_max_table_instances=200
table_definition_cache=200
table_open_cache=128
==================================================================================
mysql 启动命令 /etc/init.d/mysql start
/etc/my.cnf配置如下

# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/5.6/en/server-configuration-defaults.html
# *** DO NOT EDIT THIS FILE. It's a template which will be copied to the
# *** default location during install,and will be replaced if you
# *** upgrade to a newer version of MySQL.

[mysqld]
port= 3306
character-set-server=utf8
performance_schema_max_table_instances=200
table_definition_cache=200
table_open_cache=128
innodb=OFF
default-storage-engine=MYISAM
default-tmp-storage-engine=MYISAM
loose-innodb-trx=0 
loose-innodb-locks=0 
loose-innodb-lock-waits=0 
loose-innodb-cmp=0 
loose-innodb-cmp-per-index=0
loose-innodb-cmp-per-index-reset=0
loose-innodb-cmp-reset=0 
loose-innodb-cmpmem=0 
loose-innodb-cmpmem-reset=0 
loose-innodb-buffer-page=0 
loose-innodb-buffer-page-lru=0 
loose-innodb-buffer-pool-stats=0 
loose-innodb-metrics=0 
loose-innodb-ft-default-stopword=0 
loose-innodb-ft-inserted=0 
loose-innodb-ft-deleted=0 
loose-innodb-ft-being-deleted=0 
loose-innodb-ft-config=0 
loose-innodb-ft-index-cache=0 
loose-innodb-ft-index-table=0 
loose-innodb-sys-tables=0 
loose-innodb-sys-tablestats=0 
loose-innodb-sys-indexes=0 
loose-innodb-sys-columns=0 
loose-innodb-sys-fields=0 
loose-innodb-sys-foreign=0 
loose-innodb-sys-foreign-cols=0
# wait_timeout=288000
# 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 = 64M

# 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 values.
 join_buffer_size = 64M
# sort_buffer_size = 2M
# read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

相关文章

文章浏览阅读903次。4.清除缓存目录(/var/cache/yum)下的软件...
文章浏览阅读1.5k次。Python 是一种高级解释性编程语言,已被...
文章浏览阅读2.6k次。打开终端或控制台,以root或具有sudo权...
文章浏览阅读744次,点赞24次,收藏26次。目标:通过AppSrv为...
文章浏览阅读1.1w次,点赞8次,收藏26次。chmod命令来自于英...
文章浏览阅读1.2k次。yum源的URL地址,本例中是文件系统的路...