Learn how to Drop a MySQL Desk in Python

First, you will have the mysql.connector. In case you are not sure of get this setup, confer with Learn how to Set up MySQL Driver in Python.

Learn how to Delete/Drop a MySQL Desk in Python#

import mysql.connector

mydb = mysql.connector.join(
  host = "localhost",
  person = "username",
  password = "YoUrPaSsWoRd",
  database = "your_database"
)

mycursor = mydb.cursor()
sql = "DROP TABLE prospects"
mycursor.execute(sql)

Learn how to Delete/Drop Provided that MySQL Desk Exists in Python#

import mysql.connector

mydb = mysql.connector.join(
  host = "localhost",
  person = "username",
  password = "YoUrPaSsWoRd",
  database = "your_database"
)

mycursor = mydb.cursor()
sql = "DROP TABLE IF EXISTS prospects"
mycursor.execute(sql)