5.7.2 1&1 hosting database "SQLSTATE[HY000] [2002] Connection refused"

Permalink
I am currently unable to install Concrete5 on our 1 and 1 server.

As current I am seeing the "SQLSTATE[HY000] [2002] Connection refused" error.

I have searched the forum but have been unable to find any solutions.

1 Attachment

View Replies:
hudsonarmstrong replied on at Permalink Reply 1 Attachment
I would be grateful for any help. I have attached a PDF showing my PHP details.
goodnightfirefly replied on at Permalink Reply
goodnightfirefly
If you are using '127.0.0.1' as the database host, try 'localhost' instead.
getsupport replied on at Permalink Reply
getsupport
Hello,

The SQL error code 2002 means: disk full.


.
TheRealSean replied on at Permalink Reply
TheRealSean
I don't think this is the issue with the 1and1 issue(SQLSTATE[HY000] [2002]), its looking more likely to be an issue with the way concrete5 connects using sockets?.. but I have not gotten to the bottom of it yet so can not say for certain.

I would be grateful if anyone out there managed to get it working? with 5.7.2+
hudsonarmstrong replied on at Permalink Reply
Thanks for the forum feedback. I am still unsure why I was experiencing issues with 1&1 as I was using the correct database host and disk wasn't full :S

I have now managed to install 5.7.2 on an alternative server which resolves the immediate issue.
TheRealSean replied on at Permalink Reply
TheRealSean
After some head banging and playing about in the PDODriver file, I think I have figured out the issue

For me the localhost uses the socket within it ie
'server' => 'localhost:/tmp/mysql5.sock',


I noticed the Driver.php file mentioned unix_xoket can be passed as a parameter, so I moved the socket to that minus the colon ":" and now I am in, hope it helps?
return array(
    'default-connection' => 'concrete',
    'connections' => array(
        'concrete' => array(
            'driver' => 'c5_pdo_mysql',
            'server' => 'localhost',
            'database' => 'dbName',
            'unix_socket' => '/tmp/mysql5.sock',
            'username' => 'dbUsername',
            'password' => 'dbPassword',
            'charset' => 'utf8'
        )
    )
);
TheRealSean replied on at Permalink Reply
TheRealSean
To do this from a fresh install I had to tweak the host name a little ;) to include the socket

'localhost;unix_socket=/tmp/mysql5.sock',