Jump to content

MySQL pconnect() hanging?


jpb83

Recommended Posts

Using MySQL 5.0.26.

 

I believe MySQL is hanging.  Note the following code:

--------

  echo "in connect<br>";

@ $db = mysql_pconnect( $host, $user, $password);

 

  echo "after<br>";

--------

 

It shows "in connect", but never gets to "after".  So, I believe the problem must occur in the mysql_pconnect() call.  However, I can't seem to determine from anywhere if this is a common occurence or if there are any typical causes of this behavior.

 

Any ideas?

 

JPB

 

Link to comment
https://forums.phpfreaks.com/topic/162248-mysql-pconnect-hanging/
Share on other sites

Try not suppressing errors when you're trying to debug. Sounds logical? Yeah.

 

Just found this on php.net

You need to be VERY careful when using LOCK TABLES with persistent connections.  If the script terminates before the UNLOCK TABLES is executed, the the table(s) will stay locked, and very likely hang future scripts.  This is noted in a bug report, but is still not reflected in the documentation: http://bugs.php.net/bug.php?id=7634

Remove the @ from your code (you should never use @ for any reason) and add the following two lines of code for debugging (remove them when you are done) immediately after your first opening <?php tag -

 

ini_set("display_errors", "1");
error_reporting(E_ALL);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.