Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #1526 mysqli DSN needs socket to work
Submitted: 2004-05-28 16:00 UTC
From: jl at lusidor dot se Assigned: danielc
Status: No Feedback Package: DB
PHP Version: 5.0.0RC2 (Release Candidate 2) OS: Freebsd
Roadmaps: (Not assigned)    
Subscription  


 [2004-05-28 16:00 UTC] jl at lusidor dot se
Description: ------------ Hi I run DB 1.6.4 with mysqli driver. If I dont supply socket the connection fails. Is this normal behaviour? I need to connect with 'socket' => '/tmp/mysql.sock' in the dsn array to get it to work. It seems if you supply any value for the 6th parameter as you do in the driver it must be correct and not false/null. mysqli_connect ( [string host [, string username [, string passwd [, string dbname [, int port [, string socket]]]]]])

Comments

 [2004-05-28 16:21 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-05-28 16:50 UTC] jl at lusidor dot se
require('DB.php'); $conn = new mysqli("localhost", "uname", "pword", "dbase"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", $conn->host_info); $conn->close(); $conn = mysqli_connect("localhost", "uname", "pword", "dbase"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf("Host information: %s\n", $conn->host_info); $conn->close(); $link = mysqli_init(); mysqli_real_connect($link, 'localhost', 'my_user', 'my_password', 'world'); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } printf ("Connection: %s\n.", mysqli_get_host_info($link)); mysqli_close($link); $dsn = array( 'phptype' => 'mysqli', 'username' => 'uname', 'password' => 'pword', 'hostspec' => 'localhost', 'database' => 'dbase', 'socket' => '/tmp/mysql.sock', ); $dsn2 = array( 'phptype' => 'mysqli', 'username' => 'uname', 'password' => 'pword', 'hostspec' => 'localhost', 'database' => 'dbase', ); $conn = DB::connect($dsn);works fine $conn = DB::connect($dsn2); print_r($conn); // DB_Error object Host information: Localhost via UNIX socket Host information: Localhost via UNIX socket Connection: Localhost via UNIX socket. DB_Error Object ( [error_message_prefix] => [mode] => 1 [level] => 1024 [code] => -24 [message] => DB Error: connect failed [userinfo] => [nativecode=Can't connect to local MySQL server through socket '' (2)] ** Array [backtrace] => Array ( [0] => Array ( [file] => /usr/local/lib/php/DB.php [line] => 748 [function] => PEAR_Error [class] => DB_Error [type] => -> [args] => Array ( [0] => DB Error: connect failed [1] => -24 [2] => 1 [3] => 1024 [4] => [nativecode=Can't connect to local MySQL server through socket '' (2)] ) ) [1] => Array ( [file] => /usr/local/lib/php/PEAR.php [line] => 536 [function] => DB_Error [class] => DB_Error [type] => -> [args] => Array ( [0] => -24 [1] => 1 [2] => 1024 [3] => [nativecode=Can't connect to local MySQL server through socket '' (2)] ) ) [2] => Array ( [file] => /usr/local/lib/php/DB/common.php [line] => 500 [function] => raiseError [class] => DB_mysqli [type] => -> [args] => Array ( [0] => [1] => -24 [2] => [3] => [4] => [nativecode=Can't connect to local MySQL server through socket '' (2)] [5] => DB_Error [6] => 1 ) ) [3] => Array ( [file] => /usr/local/lib/php/DB/mysqli.php [line] => 153 [function] => raiseError [class] => DB_mysqli [type] => -> [args] => Array ( [0] => -24 [1] => [2] => [3] => [4] => Can't connect to local MySQL server through socket '' (2) ) ) [4] => Array ( [file] => /usr/local/lib/php/DB.php [line] => 393 [function] => connect [class] => DB_mysqli [type] => -> [args] => Array ( [0] => Array
 [2004-05-28 16:53 UTC] jl at lusidor dot se
Do you need anymore info?
 [2004-05-28 19:16 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-06-07 01:25 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-06-25 18:39 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!