Scenario Description
The following error is reported when there is a batch of concurrent read and write requests, large amounts of SQL statements inserted, or in data migration scenarios that require SQL pre-compiling. This error indicates the number of pre-compiled SQL statements exceeds the default maximum value:
mysql_stmt_prepare failed! error(1461)Can't create more than max_prepared_stmt_count statements (current value: 16382) |
Fault Analysis
The max_prepared_stmt_count parameter limits the upper limit of prepared statements in all sessions on MySQLd at the same time. Its value ranges from 0 to 1048576, and the default value is 16382.
Error 1461 is reported in MySQL for the PREPARE statements with the value exceeding max_prepared_stmt_count.
Solution
1.Set the max_prepared_stmt_count parameter to a larger value. The recommended value is 65535.
2.You can modify the parameter template on the console, or submit an order for consultation.