Skip to content

Instantly share code, notes, and snippets.

@TuranTimur
Last active November 23, 2015 16:21
Show Gist options
  • Save TuranTimur/69bc3b392379a0e900a5 to your computer and use it in GitHub Desktop.
Save TuranTimur/69bc3b392379a0e900a5 to your computer and use it in GitHub Desktop.
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