2017-01-17 90 views
0

當我開始maxscale,我得到以下錯誤:MaxScale:無法檢索數據庫名稱

... 
2017-01-17 20:26:05 debug : qc_sqlite: Token 34 not handled explicitly. 
2017-01-17 20:26:05 debug : qc_sqlite: Token 103 not handled explicitly. 
2017-01-17 20:26:05 debug : qc_sqlite: Token 216 not handled explicitly. 
2017-01-17 20:26:05 notice : Loaded module maxscaled: V2.0.0 from /usr/lib64/maxscale/libmaxscaled.so 
2017-01-17 20:26:05 notice : Listening connections at /tmp/maxadmin.sock with protocol MaxScale Admin 
2017-01-17 20:26:05 debug : 140414757828672 [poll_add_dcb] Added dcb 0x1ad27f0 in state DCB_STATE_LISTENING to poll set. 
2017-01-17 20:26:05 notice : Using encrypted passwords. Encryption key: '/var/lib/maxscale/.secrets'. 
2017-01-17 20:26:05 error : Failed to retrieve database names: 
2017-01-17 20:26:05 error : Shard Router: Unable to load database grant information, MaxScale authentication will proceed without including database permissions. See earlier error messages for user '*******' for more information. 
2017-01-17 20:26:05 error : Failed to retrieve database names: 
2017-01-17 20:26:05 error : Shard Router: Unable to load database grant information, MaxScale authentication will proceed without including database permissions. See earlier error messages for user '*******' for more information. 

我啓用調試,並且仍然無法看到「前面」的消息是什麼! 我可以使用配置的帳戶連接到服務器,並且我沒有任何問題地運行show數據庫。

數據庫位於RDS中。

有什麼想法?

感謝

回答

0

它沒有問題,該maxscale能夠運行「顯示數據庫」,它需要顯示數據庫的明確授予,因爲它運行:

SELECT * 
FROM ( 
    ( 
      SELECT Count(1) AS ndbs 
      FROM information_schema.schemata) AS tbl1, 
    ( 
      SELECT grantee, 
       privilege_type 
      FROM information_schema.user_privileges 
      WHERE privilege_type='SHOW DATABASES' 
      AND REPLACE(grantee, '\'','')=CURRENT_USER()) AS tbl2); 

所以,沒有特別授予該priv,查詢將不會返回任何內容。

0

MaxScale用戶的授權要求在MaxScale Tutorial中描述。

[email protected]%用戶所需的補助是:

GRANT SELECT ON mysql.user TO 'maxuser'@'%'; 
GRANT SELECT ON mysql.db TO 'maxuser'@'%'; 
GRANT SELECT ON mysql.tables_priv TO 'maxuser'@'%'; 
GRANT SHOW DATABASES ON *.* TO 'maxuser'@'%'; 
GRANT REPLICATION CLIENT ON *.* TO 'maxuser'@'%';