Mysql_stmt_prepare failed! Error (1461) Can ' t create more than Max_prepared_stmt_count statements (current value:16382)
。
The replies given are as follows:
The Max_prepared_stmt_count parameter limits the upper bound of the prepared statement in all sessions on mysqld at the same time.
It has a value range of "0-1048576" and defaults to 16382.
MySQL will report a 1461 error for prepare statements that exceed max_prepared_stmt_count. Debug statement:
Mysql> show global status like '%stmt% ';
+----------------------------+--------+
| variable_name | Value |
+----------------------------+--------+
| Binlog_stmt_cache_disk_use | 0 |
| Binlog_stmt_cache_use | 0 |
| Com_stmt_close | 142593 |
| Com_stmt_execute | 170302 |
| Com_stmt_fetch | 0 |
| Com_stmt_prepare | 157761 |
| Com_stmt_reprepare | 0 |
| Com_stmt_reset | 0 |
| Com_stmt_send_long_data | 0 |
| Prepared_stmt_count | 4 |
+----------------------------+--------+
Rows in Set (0.06 sec)
Mysql> set global max_prepared_stmt_count= 124000;
Query OK, 0 rows Affected (0.00 sec)
Go prepare statment exceeds MySQL max number