my.ini如下,修改后重啟mysql解決,占用的2G內(nèi)存變成300M # For advice on how to change settings please see
# http://dev./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]
# 設(shè)置mysql客戶端默認(rèn)字符集
default-character-set=utf8
[mysqld]
# 設(shè)置3305端口
port = 3305
# 設(shè)置mysql的安裝目錄
basedir=F:\\installed\\mysql5\\mysql-5.6.49-winx64
# 設(shè)置mysql數(shù)據(jù)庫的數(shù)據(jù)的存放目錄(自動生成,不然可能報(bào)錯)
datadir=F:\\installed\\mysql5\\mysql-5.6.49-winx64\\data
# 允許最大連接數(shù)
max_connections=1000
# 允許最大連接人數(shù)
max_user_connections=100
# 服務(wù)端使用的字符集默認(rèn)為8比特編碼的latin1字符集
character-set-server=utf8
# 創(chuàng)建新表時(shí)將使用的默認(rèn)存儲引擎
default-storage-engine=INNODB
# 連接時(shí)間
wait_timeout=31536000
interactive_timeout=31536000
#解決內(nèi)存占用過高
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
|