Bug #75244 mysql --host=127.0.0.1 -e 'SHOW SLAVE STATUS\G;' ... no data
Submitted: 17 Dec 2014 10:18 Modified: 25 Jan 2015 23:28
Reporter: CHRISTIAN WITTMER Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:5.5.38 OS:Linux
Assigned to: CPU Architecture:Any
Tags: mysql batch

[17 Dec 2014 10:18] CHRISTIAN WITTMER
Description:
mysqld  Ver 5.5.38 for linux2.6 on x86_64 (MySQL Community Server (GPL))

mysql> select user,host from mysql.user where user='xxxxxx';
+--------+-----------+
| user   | host      |
+--------+-----------+
| xxxxxx | 127.0.0.1 |
| xxxxxx | localhost |
+--------+-----------+

mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=127.0.0.1 -e 'SHOW SLAVE STATUS\G;'

does not return data, but

mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=localhost -e 'SHOW SLAVE STATUS\G;'

does return data

How to repeat:
see:
SLA_xxxxxxxxxxxx:/mysql/bin/SLA # mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=localhost -e 'SHOW SLAVE STATUS\G;'
*************************** 1. row ***************************
               Slave_IO_State: 
                  Master_Host: xxxxxxxxxxxx.xx.xxx.xxxx
                  Master_User: repl
                  Master_Port: 3307
                Connect_Retry: 60
              Master_Log_File: MAS-bin.000003
          Read_Master_Log_Pos: 107
               Relay_Log_File: mysql-relay-bin.000009
                Relay_Log_Pos: 251
        Relay_Master_Log_File: MAS-bin.000003
             Slave_IO_Running: No
            Slave_SQL_Running: No
              Replicate_Do_DB: 
          Replicate_Ignore_DB: 
           Replicate_Do_Table: 
       Replicate_Ignore_Table: 
      Replicate_Wild_Do_Table: 
  Replicate_Wild_Ignore_Table: 
                   Last_Errno: 0
                   Last_Error: 
                 Skip_Counter: 0
          Exec_Master_Log_Pos: 107
              Relay_Log_Space: 448
              Until_Condition: None
               Until_Log_File: 
                Until_Log_Pos: 0
           Master_SSL_Allowed: No
           Master_SSL_CA_File: 
           Master_SSL_CA_Path: 
              Master_SSL_Cert: 
            Master_SSL_Cipher: 
               Master_SSL_Key: 
        Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
                Last_IO_Errno: 0
                Last_IO_Error: 
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 1
SLA_xxxxxxxxxxxx:/mysql/bin/SLA # mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=127.0.0.1 -e 'SHOW SLAVE STATUS\G;'
SLA_xxxxxxxxxxxx:/mysql/bin/SLA #

Suggested fix:
mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=127.0.0.1 -e 'SHOW SLAVE STATUS\G;'

should return data.
[17 Dec 2014 13:48] MySQL Verification Team
Do you have TCP protocol disabled?. Thanks.
[17 Dec 2014 14:27] CHRISTIAN WITTMER
NO, don't think so (bind 0.0.0.0), cause from remote I can:

MAS_xxxxxxxxxxxx:/mysql/bin/MAS # mysql --user=root --password=xxxxxxxxxxxx --host=10.xx.xx.xxx -e 'SHOW DATABASES;'
+--------------------+
| Database           |
+--------------------+
| information_schema |
| xxx                |
| mysql              |
| performance_schema |
+--------------------+

But I can't again:
MAS_xxxxxxxxxxxx:/mysql/bin/MAS # mysql --user=root --password=xxxxxxxxxxxx --host=10.xx.xx.xxx -e 'SHOW SLAVE STATUS\G;'
MAS_xxxxxxxxxxxx:/mysql/bin/MAS #

so something is 'very strange' with 'SHOW SLAVE STATUS'.
[17 Dec 2014 15:24] CHRISTIAN WITTMER
some more info.

I will only get DATA (SHOW SLAVE STATUS\G) when,

using --host=localhost
or
using --socket AND user has host='localhost'
[19 Dec 2014 19:07] Sveta Smirnova
Thank you for the report.

Please send output of:

SHOW GRANTS FOR xxxxxx@localhost;
SHOW GRANTS FOR xxxxxx@'127.0.0.1';
mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=127.0.0.1 -e 'SELECT USER(), CURRENT_USER(); SHOW GRANTS;'
mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=localhost -e 'SELECT USER(), CURRENT_USER(); SHOW GRANTS;'
[22 Dec 2014 13:32] CHRISTIAN WITTMER
mysql> SHOW GRANTS FOR xxxxxx@localhost\G;
*************************** 1. row ***************************
Grants for xxxxxx@localhost: GRANT ALL PRIVILEGES ON *.* TO 'xxxxxx'@'localhost' IDENTIFIED BY PASSWORD '*xxxxx'
1 row in set (0.00 sec)

########################################

mysql> SHOW GRANTS FOR xxxxxx@127.0.0.1\G;
*************************** 1. row ***************************
Grants for xxxxxx@127.0.0.1: GRANT ALL PRIVILEGES ON *.* TO 'xxxxxx'@'127.0.0.1' IDENTIFIED BY PASSWORD '*xxxxx'
1 row in set (0.00 sec)

########################################

SLA_xxxxxxxxxxxx:~ # mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=localhost -e 'SELECT USER(), CURRENT_USER(); SHOW GRANTS;'
+------------------+------------------+
| USER()           | CURRENT_USER()   |
+------------------+------------------+
| xxxxxx@localhost | xxxxxx@localhost |
+------------------+------------------+
+------------------------------------------------------------------------------------------------------------------------+
| Grants for xxxxxx@localhost                                                                                            |
+------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'xxxxxx'@'localhost' IDENTIFIED BY PASSWORD '*xxxxx'
+------------------------------------------------------------------------------------------------------------------------+

########################################

SLA_xxxxxxxxxxxx:~ # mysql --user=xxxxxx --password=xxxxxxxxxxxx --host=127.0.0.1 -e 'SELECT USER(), CURRENT_USER(); SHOW GRANTS;'
ERROR 1045 (28000): Access denied for user 'xxxxxx'@'127.0.0.1' (using password: YES)
[23 Dec 2014 21:13] Sveta Smirnova
Thank you for the feedback.

Providing you entered password correctly this can be symptom of corruption of tables in mysql database. Please provide error log file and output of CHECK TABLE mysql.user;
[24 Jan 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[25 Jan 2015 14:02] CHRISTIAN WITTMER
user tables seems OK ...

mysql> CHECK TABLE mysql.user;
+------------+-------+----------+----------+
| Table      | Op    | Msg_type | Msg_text |
+------------+-------+----------+----------+
| mysql.user | check | status   | OK       |
+------------+-------+----------+----------+

... and don't know why, but now it is working ...
... problem solved (self healing ???)

Thanks for your help.
[25 Jan 2015 23:28] MySQL Verification Team
Thank you for the feedback.