Guest User

Untitled

a guest
Mar 20th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. db = MySQLConnection(host="mysql-container", user="root", password="secret")
  2. cursor = db.cursor()
  3. cursor.execute("SHOW SCHEMAS")
  4. data = cursor.fetchone()
  5.  
  6. p = subprocess.Popen(["mysql", "-h", "mysql-container", "-P", "3306", "-u", "root", "-psecret"],
  7. stdout=subprocess.PIPE, stdin=subprocess.PIPE)
  8. p.communicate("source sql_file.sql")
Add Comment
Please, Sign In to add comment