Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > #35292 : Can't connect to local MySQL server through socket
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 10th June 05:46
sniper
External User
 
Posts: 1
Default #35292 : Can't connect to local MySQL server through socket


ID: 35292
Updated by: sniper@php.net
Reported By: dgrimes at scvl dot com
-Status: Open
+Status: Feedback
Bug Type: MySQL related
Operating System: SCO OpenServer
PHP Version: 4.4.1


Previous Comments:
------------------------------------------------------------------------

[2005-11-22 00:58:43] dgrimes at scvl dot com

I did not use the --with-mysql-sock configure option. I'll try that and
see what happens. There were quite a few differences. I'll begin going
through them tomorrow by first concentrating on the connect function.

Something I noticed was that 4.2.3 will take a couple of seconds to
connect and is successful everytime. 4.4.x gets an error immediately
two times in a row and then successfully connects on the third time.
This is consistently repeatable by stopping and restarting apache.

So, I'll start first by looking at timeout handling in the connection
function. I wish I knew how to get this into the visual debugger so
that I could place break points and watch execution. But what I'll do
is fopen a file and write the contents of memory variables I deem
suspect. It's a slow process but it works.

Thanks,
Dean

------------------------------------------------------------------------

[2005-11-21 23:44:30] sniper@php.net

Did you happen to check the diff between those files? It's kinda hard
to know WHAT change caused this problem..

Did you use the --with-mysql-sock configure option?
Did you try using the "mysql.default_socket" php.ini option?

------------------------------------------------------------------------

[2005-11-21 23:21:38] dgrimes at scvl dot com

I've done some more research. I took the ext/mysql/php_mysql.c and
ext/mysql/php_mysql.h files from version 4.2.3 and copied them into the
4.4.1 tree. Recompiled and installed. The problem has gone away. So,
somewhere therein lies the trouble. I'll continue to pursue the cause
and if I figure it out I'll let you know what I find. The one question
I have is, if I have questions regarding specific functions or
variables, can I get answers to those questions?

Thanks,
Dean

------------------------------------------------------------------------

[2005-11-19 14:18:21] dgrimes at scvl dot com

Description:
------------
I am having random failure on making a connection to MySQL. This the
code used to make the connection and has been for several years.

if (!$this->linkid =
mysql_connect($this->host,$this->user,$this->pass))

DBError(mysql_errno(),mysql_error(),"LINKID-$db",$this->mailerr,$this->sendto);

The following error is returned randomly however it happens usually
right after starting apache or after a period of inactivity:

2002 - Can't connect to local MySQL server through socket
'/d/mysql/var/mysql.so
ck' (-2146870980)

Starting with version PHP 4.3.0 is when the problem started. Version
4.2.x does not have this problem. I compiled every version until I
found where the problem started. I am currently trying to move from
4.0.6 to 4.4.1 but need to get this issue addressed.

My system:
SCO OpenServer 5.0.4 and 5.0.6
MySQL 4.1.15
Apache 1.3.34

Reproduce code:
---------------
if (!$this->linkid =
mysql_connect($this->host,$this->user,$this->pass))
DBError(mysql_errno(),mysql_error(),"$this->linkid
LINKID-$db",$this->m
ailerr,$this->sendto);


Expected result:
----------------
I expected to get a resource ID returned.

Actual result:
--------------
2002 - Can't connect to local MySQL server through socket
'/d/mysql/var/mysql.so
ck' (-2146870980)

------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=35292&edit=1
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666