Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Configuration LimeSurvey for having access to a DB through TCP/IP over SSH

  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #173773 by cavo789
Hello all


After two hours of unsuccessfull search, I'm coming to you ... I can't find by myself.


I need to install LimeSurvey on my localhost server (done, easy) and configure it to use a database stored on a server only accessible over SSH.


I'm really not familiar with this so I've tested...

1. I can start a connection through Putty, connect to mysql on the command line, give credentials and I can get the list of tables (==> the credentials are correct and no firewall problem).

2. I've installed MySQL Workbench of Oracle and create a connection (image here below). It works. SSH hostname, port, username, MySQL host, ... it's OK, I can connect on the server and get the list of tables and see tables's content.

Now, LimeSurvey and the config.php file. I can't find how...

In components->db->connectionstring, the default is "mysql:host=localhost;port=3306;dbname=limesurvey;"

I've tried a lot like

* mysql:host=ssh_user:ssh_pwd@ssh_IP:22;port=3306;dbname=limesurvey; --> don't work

* mysql:host=ssh_IP:22;port=3306;dbname=limesurvey; --> don't work

* mysql:host=ssh_IP;port=22;dbname=limesurvey; --> don't work
* ...


Of course, components->db->username and components->db->password have been correctly initialized to the credentials needed to connect on mySQL.


Do you know how to do please ?

Thanks a lot

Christophe
Attachments:
The topic has been locked.
More
5 years 7 months ago #173777 by jelo
The MySQL Workbench is opening a SSH tunnel and then connects to the MySQL database.
You cannot do that in PHP (LimeSurvey) by just changing the connection string of the database layer.

To mimic the behavior of the MySQL Workbench a simple approach would mean to open a ssh connection (different approaches to open a ssh tunnel, e.g. via php shell_exec or on OS level).
The whole topic is not LimeSurvey related. It's a database or server topic, which involves some decisions about security and performance.

You will find a lot of information when searching for keywords "Connect remote MySQL SSH tunnel"
Some pro/cons can be found here stackoverflow.com/questions/464317/conne...rver-over-ssh-in-php

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
  • cavo789
  • cavo789's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #173780 by cavo789
That's a very complete answer @jelo; thank you !

It was also my intuition that this was not possible, but I could not have described it with words as simple as the ones you used. So, now, I know that, probably, the easiest way to do what I wish (having an access to the data) would be a mysql-dump and restore it, sometimes, locally.

Thanks Jelo ! Much appreciated
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 7 months ago #173801 by DenisChenu
Maybe using ssh_fs and unix_socket for connexion can be a good idea

But jelo are totally right : totally unrelated to LimeSurvey

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose