Saturday , September 18 2021
Home / Python / Python MySQL Drop Table

Python MySQL Drop Table

9 Python MySQL Drop Table

Python MySQL Drop Database

  • Query: drop database database_name
In [ ]:
import mysql.connector
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd=""
)
mycursor = mydb.cursor()
mycursor.execute("drop database itronix")

Python MySQL Drop Table

  • Query: drop table table_name
In [6]:
import mysql.connector
mydb = mysql.connector.connect(
  host="localhost",
  user="root",
  passwd="",
  database="itronix"
)
mycursor = mydb.cursor()
mycursor.execute("drop table student")

About Machine Learning

Check Also

Python MySQL Insert Into Table

4 Python MySQL Insert Into Table Python MySQL Insert Into Table¶To fill a table in …

Leave a Reply

Your email address will not be published. Required fields are marked *