php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13466 Errors when using variables as the host parameter
Submitted: 2001-09-27 08:20 UTC Modified: 2001-10-01 22:59 UTC
From: neil dot walker at syntegra dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: neil dot walker at syntegra dot com
New email:
PHP Version: OS:

 

 [2001-09-27 08:20 UTC] neil dot walker at syntegra dot com
If I do:

$user="frank";
$pwd="skinner";
$db="db.cp-productions.f2s.com:walkern";

The following works fine:
$conn = mysql_connect("db.cp-productions.f2s.com:walkern", $user, $pwd); 

If I do:
$conn = mysql_connect($db, $user, $pwd); 

The following error occurs:
Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /web/sites/253/walkern/www.cp-productions.f2s.com/inc/news.php

I think it's something to do with the ':walkern' bit.  It works ok on my other site where I have $user="localhost".

I've tried putting it in quotes, etc.


I have tried it on a 4.06 and a 4.01 build (different ISP's) and both do the same.

Neil.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-09-27 08:25 UTC] neil dot walker at syntegra dot com
If I do:

$user="frank";
$pwd="skinner";
$db="db.cp-productions.f2s.com:walkern";

The following works fine:
$conn = mysql_connect("db.cp-productions.f2s.com:walkern", $user, $pwd); 

If I do:
$conn = mysql_connect($db, $user, $pwd); 

The following error occurs:
Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in
/web/sites/253/walkern/www.cp-productions.f2s.com/inc/news.php

I think it's something to do with the ':walkern' bit.  It works ok on my other site where
I have $db="localhost".

I've tried putting it in quotes, etc.


I have tried it on a 4.06 and a 4.01 build (different ISP's) and both do the same.

Neil.



 [2001-10-01 22:59 UTC] sniper@php.net
RTFM: http://www.php.net/manual/en/function.mysql-connect.php

The 'walkern' part is assumed to be port/unix socket path.

--Jani

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 08:01:27 2024 UTC