MySQL Forums
Forum List  »  Connector/Python

OperationalError: (2013, 'Lost connection to MySQL server during query')
Posted by: Jason Grendus
Date: April 04, 2006 01:35PM

Hi,

I'm using Python to make MySQL stored procedure calls. Unfortunately when multiple statements are executed from within the stored procedure it drops the MySQL connection, resulting in the error message above (as reported in the Python Shell window). I create only one connection from Python which I reuse during the Python session. I added the statement "start transaction;" in the stored procedure, but that hasn't helped. The recordset I'm using is small, and the stored procedure runs fine when not being called by Python.

My connection string to the server is as follows:
connection = MySQLdb.connect(
host='db_name',
user='user_name',
passwd='pw',
db='schema_name',
client_flag=131072|65536)

The stored procedure executes fine when it taps a decision branch containing only one statement.

I'm using Python 2.4, MySQL 5.0.19, on a Linux server.

Thanks for any help you can provide,

Jason

Options: ReplyQuote




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.