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