import mysql.connector 
from mysql.connector import *
#from mysql.connector import Error
#from mysql.connector import errorcode
 
try:
    # Connecting to the Database 
    mydb = mysql.connector.connect( 
    host ='0504-srv-sig', 
    database ='nsi_eleve20', 
    user ='nsi_eleve20', 
    password = 'eleve20'
    ) 
    mydb.autocommit = False
 
    cs = mydb.cursor() 
 
    # drop clause 
    # statement ="CREATE TABLE PARTY( id INT, PRIMARY KEY(id))"
    statement ="DROP TABLE PARTY"
    cs.execute(statement) 
 
    # commit changes to the database
    #  mydb.commit() 
     
    # update successful message
    print("Database Updated !")
     
except mysql.connector.Error as error :
 
    # update failed message as an error
    print("Database Update Failed !: {}".format(error))
    
    # reverting changes because of exception
    mydb.rollback()
  
 
 # Disconnecting from the database 
mydb.close() 