mysql切换数据库提示警告:Reading table information

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

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

    登录数据库后,选择数据库时发现以下提示,

mysql(root@localhost:(none))>use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

另一种情况,无法切换访问数据库,提示此信息。(我没遇到过,一并贴过来了解下)

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

(eg:shell> mysql -h 127.0.0.1 -u root -P 3306 -p -A)

root@localhost:(none) 08:23:32>use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

    意思是 预读这个库中表以及表列信息,一般原因是当库中表很多,表中数据很大时,就会出现执行use <库名>后半天没反应,连接很慢的情况,解决办法就是 -A 方式登录数据库,不会预读库中表信息。

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Database changed
mysql>

[root@fsailing1 ~]# vim /etc/my.cnf
[root@fsailing1 ~]# service mysqld restart
停止 MySQL:                                               [确定]
启动 MySQL:                                               [确定]
[root@fsailing1 ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 2
Server version: 5.0.95 Source distribution

mysql> show processlist ;    (查看进程)

复制代码 代码如下:

图片 1

您也可以在在my.cnf配置文件里进行配置:

shell> mysql -h hostname -u username -P port -p -A

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

删除这些锁表的情况,我的mysql就能正常访问了。

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

本机登录数据库,直接执行-A也是可以的。

Database changed
root@localhost:test 08:23:44>exit;

本文由皇家赌场手机版发布于首页,转载请注明出处:mysql切换数据库提示警告:Reading table information

相关阅读