解决mysqld.exe占用内存过高的问题

my.ini如下,修改后重启mysql解决,占用的2G内存变成300M

# 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.

[mysql]
# 设置mysql客户端默认字符集
default-character-set=utf8
[mysqld]
# 设置3305端口
port = 3305
# 设置mysql的安装目录
basedir=F:\\installed\\mysql5\\mysql-5.6.49-winx64
# 设置mysql数据库的数据的存放目录(自动生成,不然可能报错)
datadir=F:\\installed\\mysql5\\mysql-5.6.49-winx64\\data
# 允许最大连接数
max_connections=1000
# 允许最大连接人数
max_user_connections=100
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

# 连接时间
wait_timeout=31536000
interactive_timeout=31536000

#解决内存占用过高
performance_schema_max_table_instances=200

table_definition_cache=200

table_open_cache=128


# 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 = 128M

# 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 = .....


# 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 = 128M
 sort_buffer_size = 2M
 read_rnd_buffer_size = 2M 

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES 

你可能感兴趣的:(MySQL,mysql)