Welcome Guest, Not a member yet? Register   Sign In
Connect to database over SSH
#1

[eluser]Martin Rusev[/eluser]
Hi all,

I have the following problem. My Codeigniter application is build and hosted on Server 1.
Server 1 doesn't have Database installed. The only way to use database in my application is to connect remotely to Server 2 via SSH.

My question is : Is it possible to do this in Codeigniter or I must add additional libraries?

Thank you in advance for your time and attention Smile
#2

[eluser]johnwbaxter[/eluser]
You'll have to do a fair amount of this outside CI as there is no ssh lib or anything like that.

Shouldn't be too hard though.
#3

[eluser]sensimevanidus[/eluser]
What does "using a database by connecting remotely to Server2 via SSH" means? I couldn't understand your saying frankly. Does this mean that you can only connect locally to the database found on the Server2, not remotely?
#4

[eluser]Martin Rusev[/eluser]
I am sorry if they are any misunderstandigs :0

My application is on Server 1, database on Server 2.

That means - I have to connect to Server 2 via SSH and then using that tunnel connection, to use the installed there mysql server for my application on Server 1
#5

[eluser]Tom Glover[/eluser]
[quote author="Martin Rusev" date="1224094776"]I am sorry if they are any misunderstandigs :0

My application is on Server 1, database on Server 2.

That means - I have to connect to Server 2 via SSH and then using that tunnel connection, to use the installed there mysql server for my application on Server 1[/quote]

Can't you tell MySQL on Server two to allow connections from Server one, this is remote server connections.
#6

[eluser]Martin Rusev[/eluser]
It works Smile

Thank you very much
#7

[eluser]Tom Glover[/eluser]
[quote author="Martin Rusev" date="1224099910"]It works Smile

Thank you very much[/quote]

No Problem, are you using remote MySQL Connections?
#8

[eluser]Martin Rusev[/eluser]
I used this:

http://dev.mysql.com/doc/refman/5.0/en/c...ccess.html

and then i just changed the "host" value in database.php in my Codeigniter application.




Theme © iAndrew 2016 - Forum software by © MyBB