peyups Posted July 24, 2003 Share Posted July 24, 2003 hi all, m currently using the PEAR module of php4.06 on top of redhat. Our provider implemented a new installation for mysql wherein the mysql.sock file was created in another directory instead of the default (\'/tmp/mysql.sock). Using mysql_connect, this was achieved using localhost:/path/to/socket but this could not be achieved using pear class ; DB::connect(\"mysql://$dbuser:$dbpass@$dbhost:/path/to/socket/$dbname\"). I\'ve tried enclosing it in single quotes etc... it can\'t connect to that socket i think because of the forward slash (/). Any ideas? couldn\'t change the location of the mysql sockets coz we are only hosting it their. All help would be very much appreciated. thanks Link to comment https://forums.phpfreaks.com/topic/774-pear-connecting-to-mysql-using-a-different-socket/ Share on other sites More sharing options...
barbatruc Posted July 25, 2003 Share Posted July 25, 2003 In the doc of PEAR :: DB, there is the following example: Connect to database through a socket: mysql://user:pass@unix(/path/to/socket)/pear So basically, in your case you would have: mysql://$dbuser:$dbpass@tcp(/path/to/socket:port):/$dbname" Hope this helps. JP. Link to comment https://forums.phpfreaks.com/topic/774-pear-connecting-to-mysql-using-a-different-socket/#findComment-2591 Share on other sites More sharing options...
peyups Posted July 28, 2003 Author Share Posted July 28, 2003 thanks bro... Link to comment https://forums.phpfreaks.com/topic/774-pear-connecting-to-mysql-using-a-different-socket/#findComment-2614 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.