2017-07-29 16:40:24
来 源
中存储网
MySQL入门教程
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)

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

声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。