0

SQL錬金術を使用して現在のスレーブラグを取得する方法はありますか? session.execute('show slave status') は行を返さないようです:

In [0]: list(session.execute('show slave status'))

ResourceClosedError: This result object does not return rows. It has been closed automatically.
4

1 に答える 1

2
from sqlalchemy import create_engine

engine = create_engine('mysql+pymysql://username:password@your.hostname.com/')
connection = engine.connect()
result = connection.execute("SHOW SLAVE STATUS") 
for row in result:
   for k in row.keys():
     print k, ' >>> ', row[k]
于 2013-01-19T01:59:45.600 に答える