Home > Database > Mysql Tutorial > MySQL-Ignoring query to other database solution

MySQL-Ignoring query to other database solution

黄舟
Release: 2017-03-11 14:41:30
Original
2585 people have browsed it

Linux command line successfully logs in to mysql and executes the command to report Ignoring query to other database.

[mysql@bjdev01 ~]$ mysql -Uroot -p
Enter password: 
mysql> select now();
Copy after login

Ignoring query to other database

mysql> exit
Bye
Copy after login

Log out and log in again, normal.

[mysql@bjdev01 ~]$ mysql -uroot -pEnter password:
mysql> select now();
+---------------------+
| 
now()               |
+---------------------+
| 2014-01-27 10:29:47 |
+---------------------+
1 row in set (0.00 sec)
Copy after login

Compare the two login commands:
First login: mysql -Uroot -p
Second login: mysql -uroot -p

It was found that one of the parameters used is an uppercase U and the other is a lowercase u, and the two parameters are The meaning is different.

Checked the help of mysql and found that lowercase u and uppercase U represent different meanings

[mysql@bjdev01 ~]$ mysql --help| egrep 'user|safe-updates'
  -u, --user=name     User for login if not current user.
  -U, --safe-updates  Only allow UPDATE and DELETE that uses keys.
  -U, --i-am-a-dummy  Synonym for option --safe-updates, -U.
  --select-limit=#    Automatic limit for SELECT when using --safe-updates.
                      --safe-updates.
user                              (No default value)
safe-updates                      FALSE
Copy after login

If you add -U to log in to mysql, you must add conditions to the update and deletion of data. .

The above is the detailed content of MySQL-Ignoring query to other database solution. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template