LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-18-2009, 04:15 AM   #1
methoxcy
Member
 
Registered: Dec 2007
Posts: 48

Rep: Reputation: 16
Error In PHP in linux


Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in /var/www/html/GetTime2.php on line 63
Could not connect: Lost connection to MySQL server during query



im using linux mandriva 2007 and I already uninstall the mysql5 then intall again coz i think its just a bugs but i saw it again what should i do?
 
Old 02-18-2009, 08:04 AM   #2
immortaltechnique
Member
 
Registered: Oct 2006
Location: Kenya
Distribution: Ubuntu, RHEL, OpenBSD
Posts: 287

Rep: Reputation: 32
Looks like there is a connection issue to your database. Can you ping your mysql server? What mysql query application are you using?
 
Old 02-18-2009, 09:09 AM   #3
Spudley
Member
 
Registered: Mar 2003
Location: Berkshire, England.
Distribution: SuSE 10.0
Posts: 299

Rep: Reputation: 32
Does this same error happen every time you run the same query?

How about other queries?

Is there any pattern other obvious to it?


It's an error message that would worry me if I saw it, because it looks like the query that you're passing is causing the DB connection to be dropped.

If it's happening consistently in the same place, then I'd suggest there's something in that specific query which is causing MySQL to freak out. This could mean that you're triggering a fatal error, possibly you've found a bug in MySQL.

Firstly, are you running the latest versions of PHP and MySQL? If not, consider updating and trying again -- if you have found a bug, it may have been fixed already.

If you can get it to happen consistently, try printing the query to screen before it crashes, and then see what happens when you run that same query directly at the MySQL command prompt. That might give you a better diagnostic message of what exactly is going wrong.

Also, once you know what the query is that's triggering it, you can try tweaking it to see if you can find out what part of the query is triggering it.

Hope that helps, and I hope you manage to solve the problem. (if you do, please let us know what it was!)

All the best,


Spudley.
 
Old 02-18-2009, 02:57 PM   #4
servat78
Member
 
Registered: Jan 2009
Posts: 100

Rep: Reputation: 17
Maybe your scripts have multiple opening commands for the same database, and the older database pointer becomes invalidated. Another possibility is that your script does some very time-consuming operation and some time-out occurs, but that would actually cease the script completely.
My guess is that this is rather due to your script, then anything related to the installation itself.

Debian

Last edited by servat78; 02-19-2009 at 12:29 PM.
 
  


Reply


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
PHP+Apache2: undefined symbol error on linux box vkaur Linux - General 4 06-15-2007 08:46 AM
PHP5 Upgrade Error: Missing Dependency: php = 4.3.x is needed by package php-pear vsystems Linux - Server 1 05-02-2007 08:17 AM
php Installation error in linux gobinath Linux - Software 3 12-17-2005 02:51 AM
Error: failed dependencies installing php-4.3.5 on redhat linux 9 lynsue Linux - Software 3 04-30-2004 05:50 AM


All times are GMT -5. The time now is 10:49 AM.

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