MySQL encountered the problem of igning query to other database
root@support~]#mysql-root-p--socket=/tmp/mysql.sock
Enterpassword:
WelcometotheMySQLmonitor.Commandsendwith;or\g.
YourMySQLconnectionidis5
Serverversion:5.6.22-logSourcedistribution
Copyright(c)2000,2011,Oracleand/oritsaffiliates.Allrightsreserved.
OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.
Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
mysql>showdatabases;
Ignoringquerytootherdatabase
mysql>showslavestatus\G
Ignoringquerytootherdatabase
->Ctrl-C--exit!
Aborted
Ignoring query to other database
I couldn’t figure it out, but later I found out the reason for the error. It turned out that the username was missing -u
Wrong: mysql -root -p –socket=/tmp/mysql.sock
Right: mysql -uroot -p –socket=/tmp/mysql.sock
[root@support~]#mysql-uroot-p--socket=/tmp/mysql.sock
Enterpassword:
WelcometotheMySQLmonitor.Commandsendwith;or\g.
YourMySQLconnectionidis6
Serverversion:5.6.22-logSourcedistribution
Copyright(c)2000,2011,Oracleand/oritsaffiliates.Allrightsreserved.
OracleisaregisteredtrademarkofOracleCorporationand/orits
affiliates.Othernamesmaybetrademarksoftheirrespective
owners.
Type'help;'or'\h'forhelp.Type'\c'toclearthecurrentinputstatement.
mysql>showdatabases;
+--------------------+
|Database|
+--------------------+
|information_schema|
|_client|
|mfi_appstore|
|mfi_boss_admin|
|mysql|
|performance_schema|
|test|
+--------------------+