php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4678 Wont Connect to MySQL using any other port/socket/host then the default
Submitted: 2000-05-29 20:37 UTC Modified: 2000-05-29 20:53 UTC
From: darren at php3hosting dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 4.0.0 Release OS: Linux Slackware
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: darren at php3hosting dot com
New email:
PHP Version: OS:

 

 [2000-05-29 20:37 UTC] darren at php3hosting dot com
$mysql_link = mysql_connect('localhost:/tmp/mysql.fred','indigo','colour'); # open MySQL connection

Will fail. It will try the local host but ignore the socket. I have tried using 127.0.0.1/the domain name and a port number. Every combination I could think of but it still won't work.

One solution I was give was :-
Copy  file libmysqlclient.so.6 from /your/path/to/mysql/lib/mysql to /usr/local/lib

But that didn't work. Although PHP3 works fine.

My Configure line is :-
'./configure' '--with-mysql=/usr/local/mysql' '--enable-track-vars''--with-apxs=/usr/local/apache/bin/apxs'

php.ini was unchanged. Every user has a MySQL instance with a different port number on shared IP address's PHP3 works fine but PHP won't talk to the unix socket..

Regards
Darren

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-29 20:53 UTC] zeev at cvs dot php dot net
Fixed - mysql_connect() was ignoring the socket argument with non persistent connects.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 00:01:34 2025 UTC