Cannot connect

  • Profile Image
    Anna Clemann
    Asked on January 31, 2012 at 12:03 AM


    When I try to past in the code, the page comes up with this message 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'.

    Is this something I am doing wrong? Any help would be much appreciated - all the rest is very clear.


  • Profile Image
    Answered on January 31, 2012 at 05:40 AM

    Is this in reference to this article?

    It sounds like your script isnt able to connect to MySql on your webserver.

    Is mysql definately running? 

    Is the php file on the same server as the mysql server?

  • Profile Image
    Answered on January 31, 2012 at 08:07 PM

    Thanks fxr - I have tried it again this morning and it worked fine, so I am guessing there was something wrong at my end yesterday. It works perfectly now.