TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Advanced PHP Programming (http://www.talkphp.com/advanced-php-programming/)
-   -   MySQL database connection with help of SSH tunneling (http://www.talkphp.com/advanced-php-programming/3094-mysql-database-connection-help-ssh-tunneling.html)

yusufeen 07-10-2008 10:21 AM

MySQL database connection with help of SSH tunneling
 
Hello All,

I would like to connect MySQL database from PHP, with help of SSH tunneling. I suppose/want to use "ssh2_connect" and "ssh2_..." sets of commands.

Queries are that can I use these sets of command for this purpose, and if yes how can I do that.

Thanks in advance.

Regards,

Jim 07-10-2008 10:53 AM

Well, to login to your mysql demon from ssh cli you use the following command:

> mysql -u username -p
> password

And you are now able to use the mysqld from ssh. You use "quit" to stop using the server.

But may I ask why you want to do it over ssh?

As for the ssh2_* functions, never used them so I can't help you with that :)

yusufeen 07-10-2008 11:21 AM

Quote:

Originally Posted by Jim (Post 16836)
As for the ssh2_* functions, never used them so I can't help you with that :)

Are you sure we cannot able to connect mysql from PHP with the help of ssh2_* ? My main query is based on that. I really would like to know that if this is possible or not ?

Jim 07-10-2008 11:24 AM

Well if you can connect to ssh you should be able to use mysql. But it would be pretty difficult to use compared with the normal mysql functions.

sketchMedia 07-10-2008 11:34 AM

this may be of some use: http://chxo.com/be2/20040511_5667.html


All times are GMT. The time now is 06:39 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0