Remote database connection does not work with '$' in database username

Mehr
5 Monate 6 Tage her #179081 von SimonCropper
Hi Everyone,

This is as much a warning as a request for an explanation.

I have been trying the establish a remote MySQL / MariaDB connection for my LimeSurvey CE instance. LimeSurvey is on one machine (front-end) and the database on another (back-end).

We had an operational instance of limesurvey working when pointing to localhost - that is, when the database was on the same machine.

The minute we updated the config files to use a remote connection, no connection was made (all firewall setting were verified as being OK).

After quite a bit of effort we discovered that the problem was the user name. It included the charcater '$'.

So, if we had a MySQL user name 'abc$def' in the config file connection settings then the connection would not work. If we changed it to 'abcdef' it did (assuming the MySQL database has a user by that name). The inclusion of the '$' symbol was purely random and worked without any issues when the database was on the same machine.

The thing that got us thinking was when we tried to make a connection and 'abc'@somedomain.com was included in the error rather than 'abc$def'@somedomain.com. It appeared the connection was being made through the command line and the symbol $ was being treated as a macro substitution character - the variable 'def' was blank so the user name was truncated from 'abc$def' to 'abc'.

Anyway, can someone explain this? Does LimeSurvey use an external program to make remote connections via a command that is chained / piped thus explaining the abovementioned behaviour or am I misinterpreting what is happening?

Any feedback would be appreciated.

Cheers Simon

Cheers Simon

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
5 Monate 5 Tage her #179137 von holch
my guess would be that LS is filtering the "$" as this symbol is used in the configuration file, see here:

github.com/LimeSurvey/LimeSurvey/blob/ma.../config-defaults.php

So I guess if your variables like the MySQL user would include $ this might be a problem for LS to work. But this is just a guess, I am not a developer.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 5 Tage her #179141 von DenisChenu
LS don't really filter , see secure.php.net/manual/en/language.variables.basics.php

$ is a special character,

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 3 Tage her #179169 von SimonCropper
The puzzling thing is that when running on localhost LS worked fine. It was only when we moved the database to another machine that we had issues. This implies that a remote connection is made differently than a local connection but I can't find the point in the code that this occurs.

Cheers Simon

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 3 Tage her #179175 von DenisChenu
Can you check application/config/config.php if you use ' or " for string here : github.com/LimeSurvey/LimeSurvey/blob/f7...sample-mysql.php#L29

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 2 Tage her #179222 von SimonCropper
I checked, and the connection string is surrounded by single inverted commas that same as your example.

Cheers Simon

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 2 Tage her #179231 von DenisChenu
Can you activate debug mode (to 2) maybe we can find where this replacement is done (but i think it's a Yii issue, not a LS issue).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 1 Tag her #179272 von holch

but i think it's a Yii issue, not a LS issue

Which makes it a LS issue, if Yii comes with LS.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds
Folgende Benutzer bedankten sich: LouisGac

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 1 Tag her #179274 von SimonCropper
Thanks for the feedack. Unfortunately LS did not even appear in the browser until this error was resolved so turning on debug will be mute. This suggests that essential data needed to present LS in the browser is stored in the database. No database connection, no LS. The only way we discovered the issue was manually connecting to the server, which in itself suggests that it is a MySQL, the MySQL linux drivers or the connection routine used by Yii that is causing the problem.

Cheers Simon

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 1 Tag her #179279 von DenisChenu

holch schrieb:

but i think it's a Yii issue, not a LS issue

Which makes it a LS issue, if Yii comes with LS.

Yes, but more hard to fix …

And clearly, i'm sure if bug is reported , it was fixed by an update to manuel «don't use $ in sql username» :P

(and it's understandable since $ is a reserved caracter in PHP)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Folgende Benutzer bedankten sich: LouisGac

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

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
captcha