Last active
November 23, 2015 16:21
-
-
Save TuranTimur/69bc3b392379a0e900a5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import oslo_db.sqlalchemy.engines as engines | |
import sqlalchemy | |
# change DBPASS and DBADDR suitable for your environment | |
url = sqlalchemy.engine.url.make_url('mysql+pymysql://keystone:DBPASS@DBADDR/keystone') | |
engine = sqlalchemy.create_engine(url) | |
con = engines._test_connection(engine, 10, 10) | |
rs = con.execute('show databases') | |
for row in rs: | |
row | |
rs = con.execute('show tables') | |
for row in rs: | |
row | |
con.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment