Today one of the Kloud51 users experienced an issue while restoring a backup:
The original question was:
I restored my website from my cPanel backup and now when I'm trying to access my site, it shows me this error:
Link to database cannot be established: SQLSTATE[HY000]  No such file or directory
I have restored before but this is the first time I'm getting this error.
The solution to fix the problem was found in a StackOverflow question: http://stackoverflow.com/questions/20723803/pdoexception-sqlstatehy000-2002-no-such-file-or-directory:
And another page on the internet saying;
You should ask support from your provider. The error message indicates that a MySQL connection via socket is tried (which is not supported). The socket is not correct or not correct installed, this means localhost or what else (IP) you added as setting for your database is not found at that location.
It could be a wrong setting you are adding (localhost instead of 127.0.0.1, or wrong IP), or mysql has crashed and file is missing. Your provider should read error logs from server and give you and advice or correct the problem.
Finally the problem have been solved by changing localhost to 127.0.0.1.