登錄數據庫后,use db很慢的問題


mysql> use dbl
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

登錄時出現這種情況,一般是有大量庫,表,字段需要掃描,會很慢,登錄庫時可以加上-A參數不進行預讀,速度會很快。

 

參考http://dba.stackexchange.com/questions/62102/mysql-database-freezing-after-use/62103

On the first "use" command after login, MySQL scans database, tables and columns name for auto completion. If you have many db, tables it could take a while.

To avoid that, launch your client with the -A option (or --no-auto-rehash)

mysql>mysql -uroot -p -A</CODE>

You could also add the disable_auto_rehash variable in your my.cnf (in the [mysql] section) if you want to disable it completely. This change does not require a reboot (it is a client, not server, variable).


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM