Max_prepared_stmt_count, maxparametercount

Source: Internet
Author: User

Max_prepared_stmt_count, maxparametercount

An error occurred while migrating data from SqlServer to MySQL.

The ole db access interface "MSDASQL" of the link server "192.168.66.53 (ewallet_lxl)" returns the message "[MySQL] [ODBC 5.2 (w) driver] [mysqld-5.5.17-log] Can't create more than max_prepared_stmt_count statements (current value: 16382 )".
Message 7343, level 16, status 4, 1st rows
The ole db access interface "MSDASQL" of the link server "192.168.66.53 (ewallet_lxl)" Cannot UPDATE the table "[MSDASQL]".

 

Solution:
The max_prepared_stmt_count parameter limits the upper limit of prepared statements in all sessions of mysqld at the same time.
The value range is "0-1048576". The default value is 16382.
Mysql reports the "Can't create more than max_prepared_stmt_count statements (current value: 16382)" error for the prepare statement that exceeds max_prepared_count.

For the site, you can increase the value first.

Generally, the default value should be enough, because the field concurrency is not that large. One possible reason is that the prepared statement is not disabled on the application side.
Directly connect to the backend MySQLDB and execute the following command:

Mysql> show global status like 'com _ stmt % ';

View the following three parameter values:
Number of times the Com_stmt_close prepare statement is disabled
Number of times the Com_stmt_execute prepare statement is executed
Number of times the Com_stmt_prepare prepare statement was created

Run the following command to modifyMax_prepared_stmt_count(This value can be dynamically modified or specified in the configuration file to restart the service)


Mysql> set globalMax_prepared_stmt_count= 100000;
Query OK, 0 rows affected (0.00 sec)

Run the migration script again... Solve the problem!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.