连接登录mysql使用-A参数

BBigSun 评论55阅读模式

提示信息

连接登录数据库的时候出现以下提示

Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A文章源自十年又十年-https://www.bbigsun.com/842.html

原因

出现问题的原因是: 我们进入mysql 时,没有使用-A参数; 当我们打开数据库,即use dbname时,要预读数据库信息,当使用-A参数时,就不预读数据库信息。文章源自十年又十年-https://www.bbigsun.com/842.html

当数据库中表非常多,如果预读数据库信息,将非常慢,可能会卡住,如果数据库中表非常少,将不会出现问题。文章源自十年又十年-https://www.bbigsun.com/842.html

解决方法

在登录时添加 -A 参数:文章源自十年又十年-https://www.bbigsun.com/842.html

mysql -hhostname -uusername -ppassword -Pport -A

举例:文章源自十年又十年-https://www.bbigsun.com/842.html

mysql -uroot -p -A
文章源自十年又十年-https://www.bbigsun.com/842.html文章源自十年又十年-https://www.bbigsun.com/842.html

纸上得来终觉浅,绝知此事要躬行。

weinxin
17688689121
我的微信
微信扫一扫
BBigSun
  • 本文由 BBigSun 发表于 2024年 5月 15日 14:00:45
  • 转载请务必保留本文链接:https://www.bbigsun.com/842.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定