Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 02-18-2009, 04:15 AM   #1
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
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
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,

Old 02-18-2009, 02:57 PM   #4
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.


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


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 > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:34 AM.

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