You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Chris Allen <li...@cjx.com> on 2007/05/04 02:55:40 UTC
Problem with Apache-DBI and local MySQL database
Dear All,
I am running:
apache 2.2.3 / mod_perl / DBI v1.54, DBD::mysql v4.004 / Apache::DBI
I am connecting to 2 MySQL databases:
1 on the local machine through a domain socket
1 over the LAN.
100% of the queries to the LAN connected db work fine
80% of the queries to the local db work fine.
But the remaining 20% generate really bizarre errors - eg:
[Fri May 04 01:44:04 2007] [error] [client 10.3.10.2] DBD driver has not implemented the AutoCommit attribute at /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm line 277.\n
DBD::mysql::db selectrow_array failed: Lost connection to MySQL server during query at /usr/lib/perl5/site_perl/Object/Root.pm line 954.
The errors only ever happen with the local (socket) database. If I connect
to this database through 127.0.0.1, then I never see the problem.
The errors also don't happen if I disable Apache::DBI
Does anybody have any idea why this is happening? Turning on Apache::DBI debugging doesn't
print anything useful.
Many thanks,
Chris Allen,
ps. This problem is 100% reproducible. I just don't know where to start looking...
Re: Problem with Apache-DBI and local MySQL database
Posted by Perrin Harkins <pe...@elem.com>.
On 5/3/07, Chris Allen <li...@cjx.com> wrote:
> [Fri May 04 01:44:04 2007] [error] [client 10.3.10.2] DBD driver has not implemented the AutoCommit attribute at /usr/lib/perl5/site_perl/5.8.8/Apache/DBI.pm line 277.\n
> DBD::mysql::db selectrow_array failed: Lost connection to MySQL server during query at /usr/lib/perl5/site_perl/Object/Root.pm line 954.
This generally means you have tried to use the same database
connection in more than one process, probably because you opened it
before forking. Apache::DBI is supposed to prevent this from
happening. You might want to turn on the Apache::DBI debugging to see
more of what's going on.
- Perrin