Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About too many connections error of mysql #186

Closed
cnsms opened this issue Jul 5, 2017 · 3 comments
Closed

About too many connections error of mysql #186

cnsms opened this issue Jul 5, 2017 · 3 comments

Comments

@cnsms
Copy link

cnsms commented Jul 5, 2017

6个客户端每分钟发来一次数据。大约一二十分钟后服务端就报错了。
1
2
3

@cnsms
Copy link
Author

cnsms commented Jul 5, 2017

2017-07-04 19:25:15 exception 'PDOException' with message 'SQLSTATE[08004] [1040] Too many connections' in C:\www\zk\thinkphp\library\think\db\Connection.php:300
Stack trace:
#0 C:\www\zk\thinkphp\library\think\db\Connection.php(300): PDO->__construct('mysql:dbname=do...', 'root', 'root', Array)
#1 C:\www\zk\thinkphp\library\think\db\Connection.php(934): think\db\Connection->connect()
#2 C:\www\zk\thinkphp\library\think\db\Connection.php(414): think\db\Connection->initConnect(true)
#3 C:\www\zk\thinkphp\library\think\db\Query.php(239): think\db\Connection->execute('INSERT INTO sy...', Array) #4 C:\www\zk\thinkphp\library\think\db\Query.php(2063): think\db\Query->execute('INSERT INTO sy...', Array)
#5 C:\www\zk\application\workerman\model\Device.php(126): think\db\Query->insert(Array)
#6 C:\www\zk\application\workerman\controller\Index.php(91): app\workerman\model\Device->abnormal(22, Array)
#7 [internal function]: app\workerman\controller\Index->app\workerman\controller{closure}(Object(Workerman\Connection\TcpConnection), '\xFF\xAA\x16\x00\\x00000000000...')
#8 C:\www\zk\Workerman\Connection\TcpConnection.php(503): call_user_func(Object(Closure), Object(Workerman\Connection\TcpConnection), '\xFF\xAA\x16\x00\\x00000000000...')
#9 [internal function]: Workerman\Connection\TcpConnection->baseRead(Resource id #84)
#10 C:\www\zk\Workerman\Events\Select.php(257): call_user_func_array(Array, Array)
#11 C:\www\zk\Workerman\Worker.php(809): Workerman\Events\Select->loop()
#12 C:\www\zk\Workerman\Worker.php(457): Workerman\Worker->run()
#13 C:\www\zk\Workerman\Worker.php(366): Workerman\Worker::runAllWorkers()
#14 C:\www\zk\application\workerman\controller\Index.php(126): Workerman\Worker::runAll()
#15 [internal function]: app\workerman\controller\Index->index()
#16 C:\www\zk\thinkphp\library\think\App.php(224): ReflectionMethod->invokeArgs(Object(app\workerman\controller\Index), Array)
#17 C:\www\zk\thinkphp\library\think\App.php(389): think\App::invokeMethod(Array, Array)
#18 C:\www\zk\thinkphp\library\think\App.php(130): think\App::module(Array, Array, NULL)
#19 C:\www\zk\thinkphp\start.php(18): think\App::run()
#20 C:\www\zk\index.php(32): require('C:\www\zk\think...')
#21 {main}

@walkor
Copy link
Owner

walkor commented Jul 5, 2017

Please use english, that can help all people to understand each other. Thanks. : -)

@walkor walkor changed the title 服务端多次接收数据后数据库连接会变多,最终导致报错。 About too many connections error of mysql Jul 5, 2017
@walkor walkor closed this as completed Jul 5, 2017
@walkor
Copy link
Owner

walkor commented Jul 5, 2017

Refer #187 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants