If it’s good to create a desk in a MySQL database utilizing Python, then you are able to do the next.
How one can 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 folks (title VARCHAR(255), handle VARCHAR(255))")
How one can Examine 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)