5.7.0 SQL Error

Permalink 2 users found helpful
When I try to install using all the same info as my install, I get this mysql error:
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Anyone know what it is or how to circumvent it?

View Replies:
ErikGebers replied on at Permalink Reply

I have the same problem (with version, it looks like the DB server is not correctly taken into account (the socket access should pop only if you are using localhost).

So far I see to options :
1) Use I just gave it a try, and the install worked without issues!
2) Try hacking For instance, I hardcoded my DB server in the file 'concrete5.7.0.2/concrete/src/Database/Connection/PDOConnection.php'
In the __construct, I added as first line:
$dsn = 'mysql:host=MY_SERVER;dbname=MY_DB';
The install started but I encountered another issue after it finished...

My advice would be to use and wait that the issues get fixed.

Good luck!
ErikGebers2 replied on at Permalink Reply
I gave a try and got the same problem again. Yet I managed to get this version installed and working hardcoding the DB connexion directly:
in the file 'concrete5.7.0.3/concrete/src/Database/Connection/PDOConnection.php'
In the __construct, I added as first line of the method:
$dsn = 'mysql:host=MY_SERVER;dbname=MY_DB';

So I kept for the other fixes, a pity that the problem is not fixed yet as it was not present in
dbleisch replied on at Permalink Reply
Fixed it by changing the variables name in :

36 if (isset($params['server']) && $params['server'] != '') {
37 $dsn .= 'host=' . $params['host'] . ';';
38 }


36 if (isset($params['host']) && $params['host'] != '') {
37 $dsn .= 'host=' . $params['host'] . ';';
38 }
munish replied on at Permalink Reply
After proposed changes, I am still getting the error..
So I went ahead and changed PDOconnect with details of database IP with log in and password. This led to error suggesting database is missing
So I went ahead and did local install, and FTPed MAMP site directory content to remote host and also added imported the local database, now site opens with only partial content.
ion replied on at Permalink Reply
a bit late, but for me it happened after a first fail in the connexion to the database (forgot to replace the local DB infos with the real ones in database.php...).
It worked doing so :
- remove the database.php file the server (in /application/config/)
- refresh the homepage, the new installation page should appear
- do not fresh install, but copy again the (right) database.php file on the server (still in /application/config/)
- now it should work !