MySQL 切换数据库、用户卡死:“You can turn off this feature to get a quicker startup with -A“处理方法
发布日期:2021-06-30 16:45:16 浏览次数:2 分类:技术文章

本文共 1523 字,大约阅读时间需要 5 分钟。

数据量很大的话,常规切换数据库会把里面所有的表遍历一遍,会很慢甚至是卡死。

解决方法:

登录的时候直接在最后面加一个 -A 就行了。

[root@localhost ~]# "/usr/local/mysql-8.0.11/bin/mysql" -uroot -p123456 -A

实战演示:

我演示的数据库就是一个数据量很大的数据库,切换数据库时半天也没有好。

mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || ncc_0807auto       || ncc_0807mysql      || performance_schema || sys                |+--------------------+6 rows in set (0.00 sec)mysql> use ncc_0807mysqlReading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with -A

加上参数后可以看到直接就切换成功了。

[root@localhost ~]# "/usr/local/mysql-8.0.11/bin/mysql" -uroot -p123456 -Amysql: [Warning] Using a password on the command line interface can be insecure.Welcome to the MySQL monitor.  Commands end with ; or \g.Your MySQL connection id is 41Server version: 8.0.11 MySQL Community Server - GPLCopyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> show databases;+--------------------+| Database           |+--------------------+| information_schema || mysql              || ncc_0807auto       || ncc_0807mysql      || performance_schema || sys                |+--------------------+6 rows in set (0.01 sec)mysql> use ncc_0807mysql;Database changedmysql>

喜欢的点个赞❤吧!

转载地址:https://lanzao.blog.csdn.net/article/details/107990615 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Linux CentOS各大网站镜像资源地址展示,各种rpm资源包下载地址,rpm安装包大全
下一篇:MySQL 技术篇- linux下mysql数据库利用binlog文件进行数据回滚实例演示,binlog恢复数据库的两种方式

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月28日 21时44分43秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章