select user,host from mysql.user;
SELECT Repl_slave_priv,Repl_client_priv,super_priv,host FROM mysql.USER WHERE USER='db';
##如果是从库,该 输出 会有 记录:
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 10.200.212.66
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 150641419
Relay_Log_File: mysql-relay-bin.000009
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: No
Slave_SQL_Running: Yes
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: 150641419
Relay_Log_Space: 240
Until_Condition: N