note 16676 added to function.mysql-connect
| From: | mrjb_no at spam_xs4all dot nl | Date: | Thu, 08 Nov 2001 17:31:55 +0000 |
| Subject: | note 16676 added to function.mysql-connect | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-20611@lists.php.net to get a copy of this message | ||
I kept getting "Can't connect to MySQL"...
If your script keeps refusing to connect to the local machine, check how MySQL is configured on your
machine: Does it use sockets or IP to connect to the database?
I found out the hard way that using '127.0.0.1' does not work on a machine that is
configured for sockets.
If it uses sockets, use hostname 'localhost'. If you connect via IP, use hostname
'127.0.0.1'. If that does not help, check if cron temporarily deletes the socket from the
default dir /tmp ,)
Hope this helps
grtz
MRJB
--
http://www.php.net/manual/en/function.mysql-connect.php
http://master.php.net/manage/user-notes.php?action=edit+16676
http://master.php.net/manage/user-notes.php?action=delete+16676
http://master.php.net/manage/user-notes.php?action=reject+16676