php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55752 Allow mysqli to connect to existing socket connection
Submitted: 2011-09-21 08:49 UTC Modified: 2017-05-15 09:49 UTC
From: casper at bcx dot nl Assigned:
Status: Suspended Package: MySQLi related
PHP Version: 5.3.8 OS: Any
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2011-09-21 08:49 UTC] casper at bcx dot nl
Description:
------------
I would like a way to allow mysqli to connect to an existing socket connection.

My use case:

I have a connection to a remote server over ssh. Using ssh2_tunnel() I can 
create 
a socket stream to the mysql server.

Currently the only way to do this is use the ssh binary to create a listening 
port 
on my local machine and point mysqli to that port. 

I prefer using ssh2 over a direct connection to mysqli because of security 
reasons. This way I can keep mysql server to listen on localhost only. Also I 
would get the added bonus of key-based authentication.

As I already use ssh2 extensively for filesystem changes on the remote machine I 
already have the keys in place to do this.

From what I've understood the mysqlnd extension already uses PHP steams 
internally, so this shouldn't be impossible.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-09-28 15:35 UTC] johannes@php.net
This is an interesting idea. As it is exotic I'm not sure we want it as a core feature and currently it is not trivial to do as plugin either. As PHP 5.4 is in beta and this feature requires some changes in the way the connection is created we can't do it for 5.4. 5.5 the soonest. Maybe we find a good way for a plugin before.
 [2017-05-15 09:49 UTC] fjanisze@php.net
-Status: Open +Status: Suspended
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 18:03:14 2021 UTC