MySQL Forums
Forum List  »  Connector/Python

Mysql and python thread (Access Denied problem)
Posted by: Mike Ng
Date: March 17, 2005 05:57PM

Hi all,

I created a python application that uses about 20 threads to process insertion into MySql. However, when I allowed the threads to do inserts into the db without lock/unlock, MySql gives me an operational error with code 1045. This error is some sort of Access Denied error, but it's not because I can't log in. My application is able to insert into the database with the threads, but some time down the line--it stops with this error. I can't figure out why this is so?? The application declares a global db connection and is passed along to all the threads for processing. This way, I believe there is only one active connection rather than multiple connections.
On the other hand, if I used a lock/unlock mechanism for the db inserts for all threads, I do not get this error.

Am I flawed in creating a global db connections and they conflict somehow? Should I create 20 db connections. I would think the problem is not with the thread conflict, since I am just inserting new records into the database and they are not overwriting each others.

Any feedback would be appreciated.

Thanks,

Options: ReplyQuote


Subject
Written By
Posted
Mysql and python thread (Access Denied problem)
March 17, 2005 05:57PM


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.