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 deal with the fault that the SELECT..INTO OUTFILE statement in MySQL can only export 1000 rows?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article will explain in detail how to deal with the failure that the SELECT..INTO OUTFILE statement in MySQL can only export 1000 lines. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Colleagues report that the customer has a set of MySQL production libraries and executes SELECT.. The INTO OUTFILE statement can only export 1000 lines

At first I thought that the system parameters had been reset, so I advised him to change the system parameters.

Mysql > set global sql_select_limit=50000000

Query OK, 0 rows affected (0.00 sec)

Colleagues reported that it did not take effect.

Log in to the database, check the system parameters, and find that the global parameters have taken effect.

Mysql > show global variables like 'sql_select_limit'

+-+ +

| | Variable_name | Value |

+-+ +

| | sql_select_limit | 50000000 | |

+-+ +

1 row in set (0.00 sec)

Check the session-level parameters and find that it is still 1000

Mysql > show session variables like 'sql_select_limit'

+-+ +

| | Variable_name | Value |

+-+ +

| | sql_select_limit | 1000 | |

+-+ +

1 row in set (0.00 sec)

Looking at the official documents, we found that the-safe-updates parameter was specified when the database was started, and when the session connected to the database, the sql_select_limit parameter was set to 1000.

When you use the-- safe-updates option, mysql issues the following statement when it connects to

The MySQL server:

SET sql_safe_updates=1, sql_select_limit=1000, max_join_size=1000000

Restart the database, remove the-- safe-updates parameter, and the database returns to normal.

Mysqld_safe-- defaults-file=/etc/my.cnf &

On "MySQL SELECT..INTO OUTFILE statement can only export 1000 lines of fault handling" this article is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge, if you think the article is good, please share it out for more people to see.

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