Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock

Discussion in 'MySQL' started by kiwigurlnz, Aug 4, 2011.

  1. #1
    Hi I'm getting the following error when I view my page:

    Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13) in /var/www/vhosts/mydomain.com/httpdocs/classes/database.php on line 24 Could not connect to host.
    Code (markup):
     

    Is anyone familiar with this? 

    Any help appreciated 
     
    kiwigurlnz, Aug 4, 2011 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    MySQL server is not running.
     
    mwasif, Aug 6, 2011 IP
  3. jaimegm

    jaimegm Member

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #3
    Ask your host provider to give you a working example
     
    jaimegm, Aug 6, 2011 IP
  4. kiwigurlnz

    kiwigurlnz Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #4
    Thanks to those who replied..All that needed to be done is to change the hostname from localhost to something else LOL
     
    kiwigurlnz, Aug 8, 2011 IP