Are you running code in a loop and check if you are incurring the n+1 problem.
App throws 500 due to max_prepared_stmt_count
Hello,
I've been developing my Laravel app used together with Backpack. Since today, all endpoints throw 500 SQLSTATE[42000]: Syntax error or access violation: 1461 Can't create more than max_prepared_stmt_count statements (current value: 16382).
This is in my main app as well as /admin/ endpoint where it e.g. redirects me to login page and says
SQLSTATE[42000]: Syntax error or access violation: 1461 Can't create more than max_prepared_stmt_count statements (current value: 16382) (SQL: select column_name as column_name from information_schema.columns where table_schema = and table_name = users)
Everything was working well for several months. I have a very basic table setup.
When I ran SHOW GLOBAL STATUS LIKE '%comstmt%'; on MySQL, I got
Com_stmt_execute 2387953 Com_stmt_close 2217228 Com_stmt_fetch 0 Com_stmt_prepare 2846723 Com_stmt_reset 0 Com_stmt_send_long_data 25094 Com_stmt_reprepare 458707
Can this be MySQL server issue or what can possibly have caused so many prepared statements to hang unclosed? I was under impression they should be tied to a session and I don't have any long-running job active, just basic views and Backpack.
Thanks for any help
Please or to participate in this conversation.