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

7 Monate 1 Woche her #173773 von 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


My Open Source software:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

LimeSurvey Partners
7 Monate 1 Woche her #173777 von 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

The meaning of the word "stable" for users

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

7 Monate 1 Woche her #173780 von 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

My Open Source software:

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

7 Monate 1 Woche her #173801 von 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey