MySQL SELECT..INTO OUTFILE语句只能导出1000行的故障
生活随笔
收集整理的這篇文章主要介紹了
MySQL SELECT..INTO OUTFILE语句只能导出1000行的故障
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
同事反映,客戶的一套MySQL生產(chǎn)庫,執(zhí)行SELECT.. INTO OUTFILE語句只能導(dǎo)出1000行
最初以為是系統(tǒng)參數(shù)被重新設(shè)置了,建議他更改系統(tǒng)參數(shù)
mysql> set global sql_select_limit=50000000;
Query OK, 0 rows affected (0.00 sec)
同事反映,沒有生效
登陸到數(shù)據(jù)庫,查看系統(tǒng)參數(shù),發(fā)現(xiàn)全局的參數(shù)已經(jīng)生效
mysql> show global variables like 'sql_select_limit';
+------------------+----------+
| Variable_name??? | Value??? |
+------------------+----------+
| sql_select_limit | 50000000 |
+------------------+----------+
1 row in set (0.00 sec)
查看會話級參數(shù),發(fā)現(xiàn)依然是1000
mysql> show session variables like 'sql_select_limit';
+------------------+-------+
| Variable_name??? | Value |
+------------------+-------+
| sql_select_limit | 1000? |
+------------------+-------+
1 row in set (0.00 sec)
查看官方文檔,發(fā)現(xiàn)當(dāng)啟動數(shù)據(jù)庫時指定了--safe-updates參數(shù),當(dāng)會話連接到數(shù)據(jù)庫后,會將sql_select_limit參數(shù)設(shè)為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;
重新啟動數(shù)據(jù)庫,去掉--safe-updates參數(shù),數(shù)據(jù)庫恢復(fù)正常
mysqld_safe --defaults-file=/etc/my.cnf &
最初以為是系統(tǒng)參數(shù)被重新設(shè)置了,建議他更改系統(tǒng)參數(shù)
mysql> set global sql_select_limit=50000000;
Query OK, 0 rows affected (0.00 sec)
同事反映,沒有生效
登陸到數(shù)據(jù)庫,查看系統(tǒng)參數(shù),發(fā)現(xiàn)全局的參數(shù)已經(jīng)生效
mysql> show global variables like 'sql_select_limit';
+------------------+----------+
| Variable_name??? | Value??? |
+------------------+----------+
| sql_select_limit | 50000000 |
+------------------+----------+
1 row in set (0.00 sec)
查看會話級參數(shù),發(fā)現(xiàn)依然是1000
mysql> show session variables like 'sql_select_limit';
+------------------+-------+
| Variable_name??? | Value |
+------------------+-------+
| sql_select_limit | 1000? |
+------------------+-------+
1 row in set (0.00 sec)
查看官方文檔,發(fā)現(xiàn)當(dāng)啟動數(shù)據(jù)庫時指定了--safe-updates參數(shù),當(dāng)會話連接到數(shù)據(jù)庫后,會將sql_select_limit參數(shù)設(shè)為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;
重新啟動數(shù)據(jù)庫,去掉--safe-updates參數(shù),數(shù)據(jù)庫恢復(fù)正常
mysqld_safe --defaults-file=/etc/my.cnf &
總結(jié)
以上是生活随笔為你收集整理的MySQL SELECT..INTO OUTFILE语句只能导出1000行的故障的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 实时搜索 elasticsearch v
- 下一篇: MySQL源码学习:MySQL中禁止跨库