0

http://go.wlg.co.nz/login.php

I had a page working fine and I swear I didn't change anything. Now its returning this:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /home/content/93/10501493/html/go/connect.php on line 15

Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/content/93/10501493/html/go/connect.php on line 16

Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/content/93/10501493/html/go/login.php on line 16

Warning: mysql_real_escape_string() expects parameter 2 to be resource, boolean given in /home/content/93/10501493/html/go/login.php on line 17

Warning: mysql_close() expects parameter 1 to be resource, boolean given in /home/content/93/10501493/html/go/connect.php on line 18

Anything obvious jumps out?

Pang
  • 9,564
  • 146
  • 81
  • 122
  • possible duplicate of [Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)](http://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38) – Manwal Oct 10 '14 at 03:49
  • Try using the local ip address (127.0.0.1) instead of 'localhost' in mysql_connect(). – Manwal Oct 10 '14 at 03:50

1 Answers1

0

Make sure mysql service is running

service mysqld start

Or

Are you connecting to "localhost" or "127.0.0.1" ? when you connect to "localhost" the socket connector is used, but when you connect to "127.0.0.1" the TCP/IP connector is used. You could try using "127.0.0.1" if the socket connector is not enabled/working.

Nitin Kaushal
  • 211
  • 1
  • 7