您的位置:金沙游乐场85155 > 大数据库 > mysql切换数据库提示警告:Reading table information

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

发布时间:2019-12-06 00:53编辑:大数据库浏览(173)

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

    想必大家在命令行操作mysql的时候会十分发愁现在的操作的是那个数据库吧,至少我就纠结过,可能您会说我打一条命令不就知道了,是的这样做确实可以的。
    可是今儿给大家介绍个好用的命令--prompt

    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

    复制代码 代码如下:

    Database changed
    mysql>

    [[email protected] ~]# mysql -uroot -p --prompt="\[email protected]\h:\d \r:\m:\s>"
    Enter password:
    Welcome to the MySQL monitor.  Commands end with ; or g.
    Your MySQL connection id is 378
    Server version: 5.0.95 Source distribution

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

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

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

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

    Enter password:

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

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

    [email protected]:(none) 08:23:32>use test;
    金沙85155登入,Reading table information for completion of table and column names
    You can turn off this feature to get a quicker startup with -A

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

    Database changed
    [email protected]:test 08:23:44>exit;

    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

    这样做的好处就是让我们大家在操作数据库时更加方便快捷。

    Database changed
    mysql> q
    Bye
    [root@localhost ~]# mysql -u root -p -A
    Enter password:
    Welcome to the MySQL monitor. Commands end with ; or g.
    Your MySQL connection id is 12
    Server version: 5.7.23 MySQL Community Server (GPL)

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

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

    复制代码 代码如下:

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

    [mysql]
    prompt=mysql(\[email protected]\h:\d)>

    本文由金沙游乐场85155发布于大数据库,转载请注明出处:mysql切换数据库提示警告:Reading table information

    关键词:

上一篇:没有了

下一篇:从 Swift 中的序列到类型擦除