Welcome to the LimeSurvey Community Forum

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

weird things in DB - connection during installprocess - what to do here..!?!

  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 5 months ago #208286 by wpfan2099
hello dear all,


i have some issues in setting up the limesurvey on a OpenSuse Server


i have created a db on a server - but if i setup the installation process i get funny errfors - all the time

Code:
Database configuration
Please enter the database settings you want to use for LimeSurvey:
 
Please fix the following input errors:
Try again! Connection with database failed.
Reason: CDbConnection failed to open the DB connection.
Try again! Creation of database failed.
Could not create database: CREATE DATABASE `umfrage` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci. Please check your credentials.
 

well i i do not know what to do now.


the issue: in short: i cannot connect to a created database - allways the system complains - there is no such db..


question: can i connect to the db in another way!? is there a other method thinkable - love to hear from you


regards
The topic has been locked.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 5 months ago #208304 by wpfan2099
by the way - i am using the newest version - the unstable that i have downloaded two days ago...

idea: can i install or create here some things manually - i guess that the connection of the installer script does not work propperly

are there any workarounds
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago - 3 years 5 months ago #208330 by DenisChenu
There are something that broke in your configuration.
If you think it can be a LS version issue : try with 3LTS version.

Since you have already a WP db : did you try with the same settings ?

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.
Last edit: 3 years 5 months ago by DenisChenu.
The topic has been locked.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 5 months ago #208354 by wpfan2099
hello dear DenisChenu,

thx for the quick reply.


well now i intalled the stable version - this one; Stable (LTS) Release 3.25.0
downloade date: 20 november 2020


errors:
Code:
Please fix the following errors:
Try again! Connection with database failed.
Reason: SQLSTATE[HY000] [2002] No such file or directory


btw: i once have had this error: one year ago

forums.limesurvey.org/forum/installation...-no-such-file-or-dir


at the moment i do not know what was going on and how i got this fixec one year ago


any idea
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 5 months ago #208356 by DenisChenu
Hi,

wpfan2099 wrote: at the moment i do not know what was going on and how i got this fixec one year ago

Always a good idea to put detail on fix ;)

wpfan2099 wrote: any idea

No, sorry ...

Strangely : yo didn't have any issue with WP ?

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.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 5 months ago #208362 by wpfan2099
hello dear Denis,:)


many thanks for the quick reply - great to hear from you again


youre right it is a good idea to add the solution to the fix. All i remember i that in the last year i had several issues.
And probably also some that i assumed that the interaction between WP (and probably some .htaccess-weird-things were causing issues. Besides this - i have had some session-trouble that time : the session path was not writeable

to sume up the old issues: sometimes i stuck within the installation process - and the installer-script came to a halt in the mid. And yes - addtionally i have had the issues that are described in the linked thread ( see the cited link) where the db-connection probably caused the issue#



nowadays:
but in these days -(note: we have set up a new server and we re on a pretty new (that means: actual ) version of PHP. So all that general things are set quite well - and i have

In this time it seems to be a bit easier: i only struggle with the DB-connection. All things goes well - untill i try to connect with the installer to the DB. This step fails in both (versions)


- the LTS 3 Version and
- the unstable version


i am trying to figure out what goes wrong here - i try to find out more about the error message.

Any thing i could do else - can i do some manual - configurations - e.g. to go round the installer-script!??

look forward to hear from you again

have a great day
The topic has been locked.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 5 months ago #208364 by wpfan2099
hello dear Denis,


many thanks for the help - and the hints - so far: well i guess i have to digg deeper with that error-message:

Code:
SQLSTATE[HY000] [2002] No such file or dir


see the many findings of issues - all over the board here. - some issues and errors that i have encountered and some of outhers.


that said: i really like Limesurvey - but i have to take care that it runs on my platform as well. So i will have to talk to my server-admin - we need to have a closer look at the mysql-sockets.. - see more below: And after that i will come back and report all the findings.


at the moment - the installation (db-connection) fails with both - the LTS3 and the unstable brandnew version.. Weird things - arent they!`?


see the threads:


forums.limesurvey.org/forum/installation...-no-such-file-or-dir
forums.limesurvey.org/forum/installation...-no-such-file-or-dir
forums.limesurvey.org/forum/installation...-sqlstate-hy000-2002





here some more findings: the folks / and user that face the same issue with the mentioned survey script as i do - they have posted some ideas and findings - food for thought:

cf: www.limesurvey.org/forum/installation-a-...-sqlstate-hy000-2002

klaus said: I run LimeSurvey on Linux for a few years now. After a reboot, probably an update, lime does not start anymore. I get the error
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] No such file or directory



Kevin: also answered in the above mentioned thread: I updated to 2.62.2+170203 a few days ago and I am also having the same issue. I got the error a few times after the update but refreshing the page seemed to work. Now I can't login or view a survey.
I can connect from the command prompt.


shru123:

I am facing same issues, I have installed new version of Apache 2.4.25 , php version 7.1.1. but in php 7.1.1 not supporting MySQL driver, it supports only mysqli. and limesurvey doesn't work without MySQL driver. please help me its urgent what to do.



Following my research I looked for the connectionstring in the config.php and found:
Code:
'connectionString' => 'mysql:unix_socket=/usr/local/LimeSurvey/var/LimeSurvey_mysqld.sock;dbname=limesurvey;',

stackoverflow.com/questions/29695450/pdo...ch-file-or-directory

Quick test (run in shell):
Code:
php -r "new PDO('mysql:hostname=localhost;dbname=test', 'username', 'password');"

some ideas:
SQLSTATE[HY000] [2002] No such file or directory means php cannot find the mysql.default_socket file. Fix it by modifying php.ini file. On Mac it is mysql.default_socket = /tmp/mysql.sock (See PHP - MySQL connection not working: 2002 No such file or directory)
SQLSTATE[HY000] [1044] Access denied for user 'username'@'localhost' CONGRATULATION! You have the correct mysql.default_socket setting now. Fix your dbname/username/password.


a tipp: You need to change host from localhost to 127.0.0.1

[[
Laravel 4: In your app/config/database.php try changing host from localhost to 127.0.0.1
Laravel 5: In the .env file, change DB_HOST from localhost to 127.0.0.1
]]


and a highly rated tip - with tremendous ratings and many many agreements:

Code:
see:PDOException SQLSTATE[HY000] [2002] No such file or directory

stackoverflow.com/questions/20723803/pdo...ch-file-or-directory

the error message indicates that a MySQL connection via socket is tried (which is not supported).
In the context of Laravel (artisan), you probably want to use a different / the correct environment. Eg: php artisan migrate --env=production (or whatever environment). See here.

I had the exact same problem. None of the above solutions worked for me. I solved the problem by changing the "host" in the /app/config/database.php file from "localhost" to "127.0.0.1".

Not sure why "localhost" doesn't work by default but I found this answer in a similar question solved in a symfony2 post. stackoverflow.com/a/9251924/1231563

Update: Some people have asked as to why this fix works so I have done a little bit of research into the topic. It seems as though they use different connection types as explained in this post stackoverflow.com/a/9715164/1231563

The issue that arose here is that "localhost" uses a UNIX socket and can not find the database in the standard directory. However "127.0.0.1" uses TCP (Transmission Control Protocol), which essentially means it runs through the "local internet" on your computer being much more reliable than the UNIX socket in this case.



i will discuss all that with the server-admin - we will look for the db-socket!

i come back and report all the findings


cheers
The topic has been locked.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 5 months ago #208450 by wpfan2099
hi there did allmost everything.

- created new db - with new user
- used a old db and user - which works perfectly since years now.


- results: all failed - everything failed- with both the old and the new installation

any idea!`?

look forward to hear from you
The topic has been locked.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #208570 by wpfan2099
Any ideas of Workarounds for solving these issues!?

look forward to hear from you

regards
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208579 by holch
It is very hard to help in your case. My guess is that there is something in your server configuration blocking Limesurvey.

Of course a Bug in Limesurvey that only appears with your very specific server configuration can't be excluded completely, but my guess would be that it is due to your server configuration at some point. Now, finding this specific configuration is tough. And nothing that someone here in the forum will be able to help I guess.

Have you tried to install Limesurvey in another server environment, just for test purposes?

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 4 months ago #208584 by DenisChenu
Hi,

Son't know exactly what happen for yo but.

There some specific system when you create a localhost string for SQL connexion : it rewrite it to go to socket. But in general this socket are /var/mysql/mysql.sock or something like this.

But it was never something like /usr/local/LimeSurvey/var/LimeSurvey_mysqld.sock directly. Here : it seems more a dpocker or something else.

Maybe try something like this : stackoverflow.com/a/6263868/2239406

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.
  • wpfan2099
  • wpfan2099's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 4 months ago #208597 by wpfan2099
hello dear Denis hello deaR Holch
first of all : many many thanks for the quick reply and for your continued suppport. I will digg deeper and will try out all you have described and mentioned.

i will look and have a closer look at all things - and yes: i come back and report all the findings.

have a great day
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose