Database problem

Permalink 1 user found helpful
Have download Version 5.7.0.2 and when i install, this error:
SQLSTATE[HY000] [2002] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

I am not running my ḿySQL on a localhost, i run at different server

View Replies:
pichan replied on at Permalink Reply
pichan
Similar problem here (as well on a remote server). The installation stops with "SQLSTATE[HY000] [2002] No such file or directory".
ErikGebers replied on at Permalink Reply
Hi, I just posted an answer to that on another thread:http://www.concrete5.org/community/forums/installation/5.7.0-sql-er...

Good luck!
peterdenk replied on at Permalink Reply
Same problem too. Running c5 in a hosted environment with db on a different server.
ErikGebers2 replied on at Permalink Reply
I gave 5.7.0.3 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 5.7.0.3 for the other fixes, a pity that the problem is not fixed yet as it was not present in 5.7.0.1...
dbleisch replied on at Permalink Reply
dbleisch
Found and resolved teh Problem
http://www.concrete5.org/developers/bugs/5-7-0-3/database-connectiv...

Fixed it by changing the variables name in :
\concrete\src\Database\Driver\PDOMySqlConcrete5\Driver.php

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

to

36 if (isset($params['host']) && $params['host'] != '') {
37 $dsn .= 'host=' . $params['host'] . ';';
38 }
evka replied on at Permalink Reply
Modifying php.ini with the correct socket information worked for me.