問題描述:
就是這么個情況,登錄數據庫切換庫時感覺很卡,需要等待幾秒鍾。
案例:
shell > mysql -uroot -ppassword mysql> use databases; Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Database changed mysql>
# 當數據庫中表比較多,且單表又比較大時,執行這個 use databases 指令就會很卡 ( 也跟機器性能有很大關系 )
解決方法:
# 這時就可以按照提示,連接時加入 -A 參數
shell > mysql -A -uroot -ppassword mysql> use databases; Database changed
# 這樣就很快了,簡直快的飛起。
參數解釋:
-A, --no-auto-rehash No automatic rehashing. One has to use 'rehash' to get table and field completion. This gives a quicker start of mysql and disables rehashing on reconnect.