通過quick參數加快mysql命令行下導出數據

mysql command line option quick

mysql -utest -p****** -htest.db.com -P33060 test --quick -Bse "SELECT CONNECTION_ID();"

結果:

Default options are read from the following files in the given order:
/etc/my.cnf ~/.my.cnf
The following groups are read: mysql client
The following options may be given as the first argument:
--print-defaults    Print the program argument list and exit
--no-defaults       Don't read default options from any options file
--defaults-file=#   Only read default options from the given file #
--defaults-extra-file=# Read this file after the global files are read

Variables (--variable-name=value)
and boolean options {FALSE|TRUE}  Value (after reading options)
--------------------------------- -----------------------------
auto-rehash                       TRUE
character-sets-dir                (No default value)
default-character-set             latin1
comments                          FALSE
compress                          FALSE
database                          (No default value)
delimiter                         ;
vertical                          FALSE
force                             FALSE
named-commands                    FALSE
local-infile                      FALSE
no-beep                           FALSE
host                              g1-off-ku-real.dns.ganji.com
html                              FALSE
xml                               FALSE
line-numbers                      TRUE
unbuffered                        FALSE
column-names                      TRUE
sigint-ignore                     FALSE
port                              3320
prompt                            mysql>
quick                             FALSE
......

也就是說,需要配置支持,纔可以導出數據,那麼可以根據個人情況在home目錄進行配置,當然最後用全局配置,這樣可以保持環境的一致性。爲了測試下面就是在home目錄配置的

~/.my.cnf

[client]
quick

再次執行

mysql -utest -p****** -htest.db.com -P33060 test --quick -Bse "SELECT CONNECTION_ID();"

結果:

4547014 # your connection id.

需要注意的就是

--quick beofore -Bse
發佈了127 篇原創文章 · 獲贊 5 · 訪問量 30萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章