angel1987 Posted November 22, 2011 Share Posted November 22, 2011 I know the regular database connection, but this time i am provided with the SSH details. This guy game me the IP address of the database server to connect and 2 login details. SSH: Username and Password DB: Username and Password And i am using XAMPP for trying out the code. Is there any plugin i need to download for SSH connections? Could you please give me the connection snippet for SSH because i don't really know how to do that, i am also searching elsewhere on internet. Thanks in advance for help... Quote Link to comment https://forums.phpfreaks.com/topic/251597-how-do-i-connect-to-external-database-in-php-using-ssh-in-xampp/ Share on other sites More sharing options...
trq Posted November 22, 2011 Share Posted November 22, 2011 You don't connect to MySql via SSH. SSH is a network protocol used to connect to remote shell sessions. Quote Link to comment https://forums.phpfreaks.com/topic/251597-how-do-i-connect-to-external-database-in-php-using-ssh-in-xampp/#findComment-1290344 Share on other sites More sharing options...
mozillaen Posted November 23, 2011 Share Posted November 23, 2011 They're probably using SSH port forwarding. If you're on Linux you'd have to create a tunnel to that server using autossh. Tunnel 127.0.0.1:3306 to 3306 on your local machine and then you should be able to connect to MySQL as though it were on your own machine (even though it's not). Quote Link to comment https://forums.phpfreaks.com/topic/251597-how-do-i-connect-to-external-database-in-php-using-ssh-in-xampp/#findComment-1290759 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.