2011-10-19 03:19:00
MySQL | "Ignoring query to other database"
A bit of a gotcha maybe, especially if you're used to the PostgreSQL CLI (where -U specifies the user name):
[user@example.com]# mysql -Uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.41-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database some_database;
Ignoring query to other database
mysql> show databases;
Ignoring query to other database
mysql> Bye
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.1.41-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database some_database;
Ignoring query to other database
mysql> show databases;
Ignoring query to other database
mysql> Bye
Although the connection to MySQL was seemingly successful, any commands only seem to result in the laconic message "Ignoring query to other database". I'm not quite sure why this happens, but -U has the following meaning in MySQL:
-U, --safe-updates Only allow UPDATE and DELETE that uses keys.
-U, --i-am-a-dummy Synonym for option --safe-updates, -U.
-U, --i-am-a-dummy Synonym for option --safe-updates, -U.
Once again a bit of a head-scratcher which would be helped at the very least by less ambiguous notification messages.
Posted at 2011-10-19 03:19:00
#mysql -Uroot -p
Instead of -U, please use -u (small letters)
So the command will be :-
#mysql -uroot -p
It will resolve your concern