MySQL在切换库时报使用-A参数,原因是当我们打开数据库,即use dbname时,要预读数据库信息。由于数据库太大,即数据库中表非常多
在使用user dbname 时会出现速度慢的现象,并报提示:
mysql> use dbname
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
然后就卡在这里。
原因是当我们打开数据库,,即use dbname时,要预读数据库信息。由于数据库太大,即数据库中表非常多,所以如果预读数据库信息,将非常慢,所以就卡住了,如果数据库中表非常少,将不会出现问题。
解决办法mysql已经有所提示:
我们进入mysql 时,没有使用-A参数:
mysql> mysql -hhostname -uusername -ppassword -Pport
当使用-A参数时,就不预读数据库信息,速度就会快起来:
mysql> mysql -hhostname -uusername -ppassword -Pport -A

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号