Skip to content

Instantly share code, notes, and snippets.

@jfach
Created September 11, 2017 16:22
Show Gist options
  • Save jfach/b2eb532690936ef67d432a64b8fe15be to your computer and use it in GitHub Desktop.
Save jfach/b2eb532690936ef67d432a64b8fe15be to your computer and use it in GitHub Desktop.
db_name = _config.get('db_name')
connection_string = "mysql://{0}:{1}@{2}/{3}".format(username,
password,
server,
db_name)
engine = sqlalchemy.create_engine(connection_string, listeners=listeners)
engine.execute("CREATE DATABASE IF NOT EXISTS {0} ".format(db_name))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment