CodeIgniter Forums
Connect to MySQL database using SSH - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Connect to MySQL database using SSH (/showthread.php?tid=74487)



Connect to MySQL database using SSH - DanielAttard - 09-30-2019

Hi!

Is it possible to connect to a MySQL database using SSH?  Couldn't seem to find any information about this online.  Thanks.


RE: Connect to MySQL database using SSH - mboufos - 10-01-2019

hello,
yeah of course. You have to connect to se the server which has the mysql server and then you can do what ever you want Smile


RE: Connect to MySQL database using SSH - Digital_Wolf - 10-01-2019

(09-30-2019, 10:41 PM)DanielAttard Wrote: Hi!

Is it possible to connect to a MySQL database using SSH?  Couldn't seem to find any information about this online.  Thanks.
If you read the answers given on stackoverflow, then I think you will understand your question.


RE: Connect to MySQL database using SSH - DanielAttard - 10-01-2019

Thanks for the stackoverflow link.  I've read the question and answers and I still don't know how to connect to MySQL using SSH.  The question you referenced has one downvote, so not particularly helpful.  I wish I could just find one good tutorial that explains how to establish an SSH connection from the database.php file.


RE: Connect to MySQL database using SSH - Digital_Wolf - 10-02-2019

Hi again ! Sorry I have not done this in my life, and since I'm from Russia it was easier for me to find the info in my native language... In General, digging a little deeper into this topic, I realized that we need some kind of program that creates a tunnel on port 3306 (this is a standard MySQL port), then you need to write a login and password from the database and try to connect through the usual function mysql_connect("localhost:3306", "user", " pass");

This program is name PuTTY


RE: Connect to MySQL database using SSH - DanielAttard - 10-02-2019

(10-02-2019, 04:57 AM)Digital_Wolf Wrote: Hi again ! Sorry I have not done this in my life, and since I'm from Russia it was easier for me to find the info in my native language... In General, digging a little deeper into this topic, I realized that we need some kind of program that creates a tunnel on port 3306 (this is a standard MySQL port), then you need to write a login and password from the database and try to connect through the usual function mysql_connect("localhost:3306", "user", " pass");

This program is name PuTTY
Hi Digital_Wolf - Thanks for your ideas.  I am familiar with PuTTY and have been using it for many years.  The problem, however, is that I need to connect to the MySQL database behind a firewall and I don't want to have to use PuTTY to get to through the firewall.

I managed to resolve my problem by updating the firewall rules to allow a connection over port 3306 to the required MySQL server.  The firewall I use is called IPCop.  Thanks for your help.


RE: Connect to MySQL database using SSH - Digital_Wolf - 10-02-2019

Not at all, glad to be of any help. As I said above, I did not use such systems, and I do not need it... I don't use other servers to have the same problems with the connection (setting up etc). As a whole I glad was than something help you !