企业空间 采购商城 存储论坛
首页 > 数据库 > MySQL入门教程 > 正文

Mysql错误:Ignoring query to other database的解决方法

2017-07-29 16:40:24来源:中存储网
导读: Ignoring query to other database解决方法,原理是登录mysql命令中没有使用-u参数,导致产生了这个mysql错误。附上解决方案,大家共勉。

Mysql错误: Ignoring query to other database解决方法

今天登陆mysql show databases出现Ignoring query to other database错误,又试了几个命令和sql全部提示Ignoring query to other database错误

错误如下:

[root@4chinastor www]# mysql -root -p(注意啊,这里一定要用-u)

Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or g.

Your MySQL connection id is 61

Server version: 5.6.35-log Source distribution

Copyright (c) 2000, 2016, 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.

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

mysql> show databases;

Ignoring query to other database

mysql> use mysql;

Database changed

mysql> show tables;

Ignoring query to other database

mysql> show databases;

Ignoring query to other database

mysql> 

这是神马情况,确定密码是没有错的啊,后来登入登出几次,折腾了半天才发现原来是在连接mysql时没有"-u"参数导致的

重新连接mysql 加上-u参数 一切正常

[root@4chinastor www]# mysql -root -p 输入mysql密码,

[root@4itcaigou www]# mysql -uroot -p

Enter password: 

Welcome to the MySQL monitor.  Commands end with ; or g.

Your MySQL connection id is 62

Server version: 5.6.35-log Source distribution

Copyright (c) 2000, 2016, 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.

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

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| information_schema |

| mysql              |

| performance_schema |

| qdmxxstor_db    |

| wwwdb              |

+--------------------+

5 rows in set (0.00 sec)

搞技术,一定要严谨啊,切记切记!

继续阅读
关键词 :
Mysql错误
中存储网声明:此文观点不代表本站立场,如有版权疑问请联系我们。
相关阅读
产品推荐
头条阅读
栏目热点

Copyright @ 2006-2021 ChinaStor.COM 版权所有 京ICP备14047533号

中存储网

存储第一站,存储门户,存储在线交流平台