Get the App
SLTechnology News&Howtos  ›  Database  › 

What should be paid attention to when writing data in bulk in mysql table

Shulou Source: shulou.com Published: 2022-06-01 18:15:47 11月13日 Update

This article mainly introduces what you need to pay attention to when writing data in bulk in the mysql table, the content of the article is carefully selected and edited by the author, and it has a certain pertinence, and it is of great significance to everyone's reference. let's work with the author to understand what we need to pay attention to when writing data in bulk in the mysql table.

Recently, when bulk migration data was written to the mysql table, an error occurred.

SQLSTATE [HY000]: General error: 1390 Prepared statement contains too many placeholders. Check mysql's official website and explain: Error: 1390 SQLSTATE: HY000 (ER_PS_MANY_PARAM) Message: Prepared statement contains too many placeholders

Cause analysis:

When mysql uses PDO for writing, PDO supports a maximum placeholder of 65535.

When the table of insert has 6 columns (that is, 6 fields) and the number of rows written to the record is 11000, the total placeholder of insert is: 6x11000=66000

66000 is greater than mysql and the maximum placeholder is 65535, so mysql

Conclusion: the written data is m-column and n-row. Mendn must be less than 65535.

After reading the above about what you need to pay attention to when writing data in bulk in the mysql table, many readers must have some understanding. If you need to get more industry knowledge and information, you can continue to follow our industry information column.

Tags: Data maximum time author industry information content reason cause analysis field meaning article more friends column knowledge conclusion reader information or Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology Shulou Tech Info Huawei Apple Docker