docker-kitchen

View on GitHub

Link

import mysql.connector
mydb = mysql.connector.connect(
    host="localhost",
    user="root",
    password="password"
)
mycursor = mydb.cursor()
mycursor.execute("CREATE DATABASE mydatabase")
mycursor.execute("show databases")
for x in mycursor:
    print(x)
...
('information_schema',)
('mydatabase',)
('mysql',)
('performance_schema',)
('sys',)