Help Center/ Relational Database Service/ Troubleshooting/ RDS for MySQL/ Performance Issues/ Native Error 1461 Reported by an RDS for MySQL DB Instance
Updated on 2022-09-21 GMT+08:00

Native Error 1461 Reported by an RDS for MySQL DB Instance

Scenario

The following error information is displayed when there are large amounts of concurrent read and write requests, large amounts of SQL statements, or in data migration scenarios:

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 value ranges from 0 to 1048576. The default value is 16382. This parameter limits the total number of prepared statements in all sessions on mysqld. The current value exceeds the value range of this parameter.

Solution

Set max_prepared_stmt_count to a larger value. The recommended value is 65535.