当前操作系统 :windows10
运行mysql版本:5.6.15
出现错误的情况是:运行java多线程,需要频繁读写数据库
错误提示:.......................Data source rejected establishment of connection, message from server: "Too many connections"
解决办法:
修改mysql配置文件,增加最大的connections
修改 mysql/bin 文件下面 my.ini 中 [mysqld] 部分增加一行:
max_connections = 1024
增加之后看着是:
[mysqld]
port= 3306
socket = "J:/xampp/mysql/mysql.sock"
basedir = "J:/xampp/mysql"
tmpdir = "J:/xampp/tmp"
datadir = "J:/xampp/mysql/data"
pid_file = "mysql.pid"
# enable-named-pipe
key_buffer = 16M
max_allowed_packet = 1M
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
log_error = "mysql_error.log"
max_connections = 1024