Welcome to the LimeSurvey Community Forum

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

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002]

  • klaus2333
  • klaus2333's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #146630 by klaus2333
Hi
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

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

So I looked for the /usr/local/LimeSurvey/var/LimeSurvey_mysqld.sock file but it was not there.
Further research results:
change the connectionString to: 'connectionString' => 'mysql:host=127.0.0.1;unix_socket=/usr/local/LimeSurvey/var/LimeSurvey_mysqld.sock;dbname=limesurvey;',

so the new error:
CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused
I found I would have to change the my.cnf and delete skip-networking, but that did not change anything.

So my first question is how to recreate the /usr/local/LimeSurvey/var/LimeSurvey_mysqld.sock file as I hope the problem is solved with that.

can anyone help? its urgent ;(

thank you!
best
Klaus
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #146653 by DenisChenu

klaus2333 wrote: Hi
change the connectionString to: 'connectionString' => 'mysql:host=127.0.0.1;unix_socket=/usr/local/LimeSurvey/var/LimeSurvey_mysqld.sock;dbname=limesurvey;',


Try
Code:
'connectionString' => 'mysql:host=localhost;port=3306;dbname=limesurvey;',

Are you sure DB still active mysql are on the same server ?
Did you try to connect with bash ?

can anyone help? its urgent ;(

support.sondages.pro/ :)

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.
  • klaus2333
  • klaus2333's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #146667 by klaus2333
Hi Denis
Thank you for your reply. Yes I am sure Lime and DB are on the same server as it is a qnap application. So the installation is not customizable. In the night we gave it a few more tries and now the new situation is:
we backed up the limesurvey SQL directory with all the .frm, myd and myi files. We also backed up the my.cnf and the config.php. Than we did a fresh lime install (as the install is default we can assume the settings are the same as in the old installation).
The fresh installation works.
We replaced the SQL directory with the backed up limesurvey .frm, .myd and .myi files and we can see our old admin login works.
The problem now is, the old surveys as the current online survey and all the other data are not visible. The LimeSurvey Database integrity check says: The following old survey tables should be deleted because they contain no records or their parent survey no longer exists: <list of our surveys>
So the new question is how do we get the surveys back into lime?
Thank you!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #146668 by DenisChenu
Surely must do a mysql check and restart ...

But you take big risk here ......

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.
More
7 years 1 month ago #148836 by Kevin
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.
The topic has been locked.
More
7 years 1 month ago #148838 by Kevin
I was able to fix it. The error showed that /tmp/mysql.sock was missing so I created a symbolic link with this command.
ln -s /usr/local/lib/mysql.sock /tmp/mysql.sock
The topic has been locked.
More
7 years 1 week ago #149958 by 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.
The topic has been locked.
More
7 years 1 week ago #149960 by jelo

shru123 wrote: 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.

What version/build of LimeSurvey is used?
To me this looks like you updated the server and now facing the issue that PHP 7.X deprecated the old mysql driver. LimeSurvey works fine with PHP 7. But you need to use a concurrent version.
If you have updated PHP before updating LimeSurvey you might roll PHP back to PHP 5.6.X to keep it running.


The error message itself can be indicate a lot of other issues as well. What version of MySQL is running?
Did you update that as well? And on what operating system in the whole stuff running?

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
7 years 1 week ago #149961 by shru123
LimeSurveyVersion 2.05+ Build 140730
mysql -MySQL server version 5.1
OS -windows server 2008

person who have issued for limesuvey have left the organization, so I don't know how to get new version of limesurvey.
do we need to pay again for new verion of limesurvey
The topic has been locked.
More
7 years 1 week ago #149962 by jelo
As a shorterm fix just switch to PHP 5.6 instead of PHP 7.X.
That should let you access LimeSurvey again.
You might consider buying a support package which will allow you to use the comfortupdater to easily access LTS versions of your installed LimeSurvey branch.
www.limesurvey.org/editions-and-prices/l...and-prices-community

Don't update your LimeSurvey installation with the newest branch. Just look out for 2.6.Z LTS and don't choose 2.6Y.Z (which is the newest branch and will break templates on your current LS installation).

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
More
7 years 1 week ago #149966 by shru123
I am not able to understand. I need to use php version as 7.1.1. But limesurvey is not working.
Connectionstring is giving problem

'connectionString' => 'mysql:host=localhost;port=3306;dbname=limesurvey;',

I need to change the above code just. can you help me. how do I do this.
The topic has been locked.
More
7 years 1 week ago #149969 by jelo

shru123 wrote: I need to use php version as 7.1.1. But limesurvey is not working.

The limesurvey version you use (2014) is older than the release of PHP 7.X.
So why do you expect changing a connection string will do the trick? You will run into further issues.

If you want to learn about the different mysql interfaces which come with PHP 7 and still want to just change connection strings, you can take a look at this here:
php.net/manual/de/mysql.php

Good luck. I would be surprised if you get this old version of LimeSurvey running flawless under PHP 7.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose