Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement batch insertion in Mysql

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you how to achieve batch insertion in Mysql, the content is concise and easy to understand, it will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

1. Create a test table:

Create table t_emp (id int (8), SNO int (8))

two。 Create PROCEDURE

DELIMITER / /

CREATE PROCEDURE test_insert ()

BEGIN

DECLARE i INT DEFAULT 0

WHILE iCALL test_insert ()

ERROR 1436 (HY000): Thread stack overrun: 10880 bytes used of a 131072 byte stack, and 128000 bytes needed. Use 'mysqld-- thread_stack=#' to specify a bigger stack.

Treatment method:

Modify the configuration file: comment out the line thread_stack = 128K, or change a larger value, and then restart mysql.

1. Modify: my.cnf

Thread_stack = 500K

2.service mysqld restart

[root@db11g etc] # service mysqld restart

Shutting down MySQL.. [OK]

Starting MySQL.. [OK]

The above is how to achieve batch insertion in Mysql. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report