PDA

View Full Version : PHPMyAdmin suddenly acting a little funny...


PaulKroll
05-16-2001, 06:18 PM
PHPMyAdmin is suddenly saying "Lost Connection" with the MySQL server while attempting to browse a particular table.... but not any other table in the same database, nor any other database.[nbsp][nbsp]Also, doing a "raw" select of the form:
"SELECT * FROM TableName LIMIT 0,30"

Is returning an "error: MySQL returned" and nothing else, as if MySQL returned a null string, and this is the case for ALL tables/databases. Doing the same query from the mysql client while telnetted in, works fine. And I'd have sworn it worked as expected in all previous attempts...

This is just darn peculiar. I swear I haven't changed PHPMyAdmin in months, but I use it all the time and this is the first time I've noticed a problem browsing any table.

Any ideas? Am I cursed? :(

Terra
05-16-2001, 06:47 PM
How long are you idling?

There is a 300 second timeout to where the MySQL server will drop you after inactivity...

'mysql' command line tool has a timeout of 900 seconds...

--
Terra
--All play and no work can lead to disconnected communication--
FutureQuest

PaulKroll
05-16-2001, 07:07 PM
It comes back with the message about 5 seconds after clicking the "Browse" link. The mysql client, as I've said, has no problem with this, it's only via PHPMyAdmin that suddenly that one, goofy table, is giving me grief.

Terra
05-16-2001, 08:32 PM
That's the second report that I've had today about PHPMyAdmin going goofy...

Did you just upgrade it or something?

There may be a hidden bug lurking about...

--
Terra
sysAdmin
FutureQuest

Terra
05-16-2001, 08:35 PM
Also, check to see if you are on the updated PHP 4.0.5 core...

You may be on a server that had to be updated due to previously disclosed issues...

--
Terra
sysAdmin
FutureQuest

PaulKroll
05-16-2001, 11:49 PM
As I said, I haven't changed PHPMyAdmin in months (last I checked, PHPMyAdmin had stagnated at 2.1.0, so I don't know that I could have upgraded it if I tried...)

However, yes, this IS a domain on Phoenix, running 4.0.5.[nbsp][nbsp]PHPMyAdmin had a couple of PHP4 issues that were solved just before the author stopped focusing on it, so I wouldn't be stunned to find a subtle bug has been brought out by the Good People at PHP.net.

On the flip side, this is so... inconsistent. There are something like 8 or nine tables in the database and only one has the lost connection on Browse problem. Curious.

Terra
05-17-2001, 01:28 AM
I'm afraid that I'm going to have to lean on you in figuring this out...

I don't use PHPMyAdmin, nor have I any experience with it...[nbsp][nbsp]It also falls into the 3rd Party Script category and I will do what I can to fix any problems that may be on our end...[nbsp][nbsp]However, someone needs to point out exactly what is wrong so the determination can be made of: "Us and Them"...

--
Terra
--And who knows which is which and who is who--
FutureQuest

PaulKroll
05-17-2001, 01:35 AM
Well this is a little odd, but...

There's a section of code in PHPMyAdmin's sql.php file, from lines 58-62, that re-runs a query without a "LIMIT" option...

I don't really know why. But it seems to do it under both PHP 4.0.4pl1, and PHP 4.0.5. Only with the one troublemaking table, under PHP 4.0.4pl1, It's able to do the query: under PHP 4.0.5, it fails with "Unable to save result set in (filepath)sql.php, line 60"

This table is 150K records. My nearest table is 39K records and has fewer fields. There's some limit that PHP 4.0.5 is choking on, that PHP 4.0.4pl1 did not. (Some days there are advantages to running domains on multiple servers. :) )

Removing (commenting out) the lines that do the non-limited-query after doing the &quot;real&quot; query, has no visible negative effect on the PHPMyAdmin Browse functionality. It >DOES< let it actually WORK with the big table, under EITHER 4.0.4pl1 or 4.0.5.

The result from the non-limited query is used only in the following line, where PHPMyAdmin uses mysql_num_rows to set $SelectNumRows.[nbsp][nbsp]Grepping for that variable reveals it's used in several places in the lib.inc.php script, but I really have no clue why it's ultimately done. It just seems incredibly wasteful. And now I'm really tired and going to sleep. :)

PaulKroll
05-17-2001, 01:37 AM
Of course I was typing while you were typing.

I think it's pretty clearly &quot;Them.&quot; Though which &quot;Them&quot; it is, that's up in the air. Doing a query once, w/Limit, and then again, without, seems pretty wrong, but why the difference in behavior from 4.0.4pl1 to 4.0.5? It's just odd. :)

dank
05-17-2001, 06:32 AM
I haven't used the PHP4 version of phpMyAdmin yet (waiting until those .php3 extensions vanish by the wayside :) ), so I can only take a shot in the dark...[nbsp][nbsp]My one, and I repeat one, thought is that the author was trying to set up a page spanning query that first finds the total number of rows (non-LIMIT query), then bypasses that with a LIMIT query on subsequent pages.[nbsp][nbsp]At least, that's what I always do...

Dan

PaulKroll
05-17-2001, 11:04 AM
I thought something like that might be the case as well, but not only is browsing not affected by removing that extra, unlimited query, but PhpMyAdmin still shows the number of records... so it must be getting that elsewhere. I suppose we can dig through the code and figure this out, but I have a distant memory of some folks taking the PhpMyAdmin base and starting a new project with it, as the original author seems to have dropped it. Think it's supposed to be on SourceForge. Might be best to look for PhpMyAdmin, the Next Generation. :)

dank
05-17-2001, 11:44 AM
I have a distant memory of some folks taking the PhpMyAdmin base and starting a new project with it, as the original author seems to have dropped it. Think it's supposed to be on SourceForge. Might be best to look for PhpMyAdmin, the Next Generation. Might you be thinking of phpAdsNew?[nbsp][nbsp]Same original author, and exactly what you described.[nbsp][nbsp]Although, it's entirely possible the same has been done with phpMyAdmin.

Dan

Arthur
05-17-2001, 12:12 PM
The new unofficial phpMyAdmin project is located at: http://phpmyadmin.sourceforge.net/

Arthur