blob: d054f60787849a7fe6b57f0a1edcaacdaaca9f9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import mysql.connector as con
import configparser
config = configparser.ConfigParser()
config.read('config.ini')
try:
config['DATABASE']
except KeyError:
config.read("../config.ini")
mycon = con.connect(host=config['DATABASE']['HOST'],user=config['DATABASE']['USER'],password=config['DATABASE']['PASSWORD'],port=config['DATABASE']['PORT'],database=config['DATABASE']['NAME'])
mycursor = mycon.cursor()
print("Removing Test Query")
jobID = "l9xo2isr98oepcia"
q = 'delete from curieweb where id="%s"' % (jobID)
mycursor.execute(q)
mycon.commit()
print("Database working perfectly")
|