mirror of
https://github.com/docker/docs.git
synced 2026-03-28 06:49:00 +07:00
Update develop.md (#17383)
Executing "USE inventory" query instead of closing and connecting again
This commit is contained in:
@@ -121,15 +121,7 @@ def db_init():
|
||||
|
||||
cursor.execute("DROP DATABASE IF EXISTS inventory")
|
||||
cursor.execute("CREATE DATABASE inventory")
|
||||
cursor.close()
|
||||
|
||||
mydb = mysql.connector.connect(
|
||||
host="mysqldb",
|
||||
user="root",
|
||||
password="p@ssw0rd1",
|
||||
database="inventory"
|
||||
)
|
||||
cursor = mydb.cursor()
|
||||
cursor.execute("USE inventory")
|
||||
|
||||
cursor.execute("DROP TABLE IF EXISTS widgets")
|
||||
cursor.execute("CREATE TABLE widgets (name VARCHAR(255), description VARCHAR(255))")
|
||||
|
||||
Reference in New Issue
Block a user