MySQL Forums
Forum List  »  Connector/Python

mysqldb interfaceError
Posted by: johanna royer
Date: April 19, 2011 03:37AM

Hi all,

I have a very weird probleme with mysqldb (mysql module for python). I have a file with queries for inserting records in tables. If I call the functions from the file, it works just fine. But when I try to call one of the functions from another file it throws me a

_mysql_exception.InterfaceError: (0, '')

I really don't get what I'm doing wrong here..

I call the function from :

import create

create.newFormat("HD", 0,0,0)

The function newFormat(..) is in (imported) :

from Database import Database

db = Database()

def newFormat(name, width=0, height=0, fps=0):
format_query = "INSERT INTO Format (form_name, form_width, form_height, form_fps) VALUES ('"+name+"',"+str(width)+","+str(height)+","+str(fps)+");"

And the class Databse is the following :

import MySQLdb from MySQLdb.constants import FIELD_TYPE

class Database():
def __init__(self):
server = "localhost"
login = "seq"
password = "seqmanager"
database = "Sequence"
my_conv = { FIELD_TYPE.LONG: int }

self.conn = MySQLdb.connection(host=server, user=login, passwd=password, db=database, conv=my_conv)
# self.cursor = self.conn.cursor()

def close(self):

def execute(self, query):

(I put only relevant code)

Traceback :

D:\ProgramFiles\Python26\lib\site-packages\MySQLdb\ DeprecationWa
rning: the sets module is deprecated
from sets import ImmutableSet
INSERT INTO Format (form_name, form_width, form_height, form_fps) VALUES ('HD',0
Traceback (most recent call last):
File "", line 182, in <module>
File "Z:\sequenceManager\mysql\", line 52, in newFormat
File "Z:\sequenceManager\mysql\", line 19, in execute
_mysql_exceptions.InterfaceError: (0, '')

The warning has never been a problem before so I don't think it's related.

Options: ReplyQuote

Written By
mysqldb interfaceError
April 19, 2011 03:37AM
April 19, 2011 06:13AM
April 20, 2011 03:54AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.