-2

Please go through the link

http://amymcnamara.com/fortest.php

here this error is giving:

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

why this error is giving??

MD.Ronjon
  • 1
  • 1

3 Answers3

1

That means that '/var/run/mysqld/mysqld.sock' doesn't exist. The most probably, mysqld is down or utilizes another socket for accepting connections.

Maksym Polshcha
  • 18,030
  • 8
  • 52
  • 77
0

You need to have mysqld.sock file, which is generated by mysql when it is turned on. Or just create empty file called 'mysqld.sock' in folder - /var/run/mysqld/

dpitkevics
  • 1,238
  • 8
  • 12
0

This Error

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /nfs/c09/h01/mnt/130514/domains/amymcnamara.com/html/fortest.php on line 2
Could not connect: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

usually occur when you give wrong domain name OR username OR Password for database connection so check your connection i think there's error.

M_A_K
  • 378
  • 3
  • 16