Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 02-11-2003, 06:01 PM   #1
LQ Newbie
Registered: Feb 2003
Location: Duluth MN
Distribution: Debian, FreeBSD, SuSE
Posts: 23

Rep: Reputation: 15
Unhappy 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...

Old 02-12-2003, 10:41 AM   #2
Registered: Jan 2003
Posts: 195

Rep: Reputation: 30
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.
Old 02-12-2003, 10:48 AM   #3
LQ Newbie
Registered: Feb 2003
Location: Duluth MN
Distribution: Debian, FreeBSD, SuSE
Posts: 23

Original Poster
Rep: Reputation: 15
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...



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql-php-apache problems.. khuti2005 Linux - Newbie 4 10-20-2005 03:28 PM
Apache,MySQL problems lord-fu *BSD 12 10-16-2005 03:13 AM
Mysql Remote Connection Problems harbringer Linux - Software 5 04-14-2005 02:42 PM
Apache/PHP/MySQL Problems! Ryand833 Linux - Software 1 04-13-2004 09:37 PM
MYSQL problems with nested connection saravanan1979 Programming 15 02-05-2003 08:29 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration