Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db = MySQLConnection(host="mysql-container", user="root", password="secret")
- cursor = db.cursor()
- cursor.execute("SHOW SCHEMAS")
- data = cursor.fetchone()
- p = subprocess.Popen(["mysql", "-h", "mysql-container", "-P", "3306", "-u", "root", "-psecret"],
- stdout=subprocess.PIPE, stdin=subprocess.PIPE)
- p.communicate("source sql_file.sql")
Add Comment
Please, Sign In to add comment