php, mysql - Too many connections to database error

前端 未结 6 1542
南方客
南方客 2020-12-03 10:40

Good day to all. I have an odd error. I have created a chat that works like this:

  • questions/answers are inserted into a db
  • every 2 seconds an ajax re
6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-03 11:34

    The error SQLSTATE[HY000] [1040] Too many connections is an SQL error, and has to do with the sql server. There could be other applications connecting to the server. The server has a maximum available connections number.

    If you have phpmyadmin, you can use the 'variables' tab to check what the setting is.

    You can also query the status table like so:

    show status like '%onn%';
    

    Or some variance on that. check the manual for what variables there are

    (be aware, 'connections' is not the current connections, check that link :) )

提交回复
热议问题