-   Linux - Software (
-   -   Mysql/Apache Connection problems... (

amish_geek 02-11-2003 06:01 PM

Mysql/Apache Connection problems...
Ok, Ive had this problem once before, and I fixed it by doing a system reinstall. But that isnt an option at this moment...

Computer Specs:
Dual PIII 500mhz
512mb RDRam
18gb 10,000rpm SCSI Drive
10/100 EtherExpress Nic (eepro100 driver module)
Running Debian 3.0r1 w/kernel 2.4.20 (SMP enabled)
Co-Located with an ISP on 5-6 T1 Lines


I just did a system reinstall this weekend, and after I got the box locked back in the ISP's server room, and back home, and was finishing up the configuration remotely, I noticed that I have this peculiar MySQL issue *again*. The issue is this...

Connections to databases via Php/Apache are randomly dropped (or so it seems). About 1 in 7 attempts ends up generating the following error message:


Warning: Lost connection to MySQL server during query in /home/thegamelan/www/pnadodb/drivers/ on line 121

Warning: MySQL Connection Failed: Lost connection to MySQL server during query in /home/thegamelan/www/pnadodb/drivers/ on line 121
mysql://root:@localhost/Rogue failed to connectLost connection to MySQL server during query
Yes yes, I realize the issues with using the root mysql account, but I have it set that way to make sure its not a user problem.

Looking through my log files, for all the good connect requests, it logs that it connected as the proper user (root) in this case, but when it generates this error, the connection was made as (www-data@localhost as anonymous) and is denied the select request. I have found a temporary solution which is to change all "mysql_connect" statements to "mysql_pconnect", but this is a pain, and I dont want to force all the sites that I host to use that. I have also noticed the speed in which my server displays websites is definately slower.

Before my system reinstall, i was running kernel 2.4.19 without SMP support, and MySQL worked fine. When I last had this problem, it was running a kernel with SMP enabled. Has anyone ever encountered this problem before? I have talked with friends who are sysadmins at ISP's and have worked with debian/apache/mysql/php for years and have coded total network control apps with php/mysql on massive servers, and NONE of them have ever encountered this issue, or have been able to help me fix it.

From the log files it appears that the problem isnt with mysql, but apache/php... And since it has only happened when I had SMP support, I am thinking that that could possibly be the cause. I have also heard rumors of a certain "switch" in apache's config to improve performance on SMP or something on that line. Could this be the problem?

I really do not want to go through another reinstall, as my box is 3 hours away, locked in a server room that I have to schedule a time to go in, take it out, then schedule a time to put it back.

Does anyone have any ideas? Ive been working on this issue since Saturday night, and have run out of ideas...


Wolven 02-12-2003 10:41 AM

Did you apt-get php and myql and apache, or did you compile it by hand? Found another guy who had similar problems and fixed it by compiling with a flag...(quoting:)


The one time I saw this error, it was cleared up by recompiling PHP with the


specifying the local directory of mysql of course.

amish_geek 02-12-2003 10:48 AM

Yes, I apt-get'ed apache mysql-server php4 php-mysql etc...

Ill give recompiling php a try....

But why this problem only exists when my box is running SMP and is fine when its not is really an enigma...


All times are GMT -5. The time now is 05:56 AM.