import mysql.connector
def func(script):
dataBase = mysql.connector.connect(
host ="localhost",
user ="user",
passwd ="password",
database = "mydb"
)
cursorObject = dataBase.cursor()
cursorObject.execute(script)
dataBase.close()