If it’s good to create a desk in a MySQL database utilizing Python, then you are able to do the next.
The right way to Create a MySQL Desk in Python
import mysql.connector
mydb = mysql.connector.join(
host = "localhost",
consumer = "username",
password = "YoUrPaSsWoRd",
database = "your_database"
)
mycursor = mydb.cursor()
mycursor.execute("CREATE TABLE individuals (title VARCHAR(255), deal with VARCHAR(255))")
The right way to Verify if a MySQL Desk Exists in Python
import mysql.connector
mydb = mysql.connector.join(
host = "localhost",
consumer = "yourusername",
password = "YoUrPaSsWoRd",
database = "your_database"
)
mycursor = mydb.cursor()
mycursor.execute("SHOW TABLES")
for x in mycursor:
print(x)