Re: I'm prepared to feel like an idiot... But I just simply need the answer :)

From: Date: Wed, 01 Aug 2007 14:46:44 +0000
Subject: Re: I'm prepared to feel like an idiot... But I just simply need the answer :)
References: 1 2 3 4 5 6  Groups: php.general 
Request: Send a blank email to php-general+get-260005@lists.php.net to get a copy of this message
Brad Bonkoski wrote:
Jason Pruim wrote:
On Aug 1, 2007, at 9:55 AM, Michael Preslar wrote:
@mysql_connect('localhost', 'user', 'password') or die("Cannot connect to DB!" . mysql_error());
..
cannot connect to DB!Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (2)qs:/volumes/raider/webserver/ documents/tests/ticklers japruim$
MySQL is running right? (I know, silly question, but have to make sure) If it is.. grep sock /etc/my.ini .. Bet the socket file its creating is in /tmp or /var/lib/mysql
Okay, so the command didn't work.. couldn't find my.ini... But I just cd'ed into /tmp and there is a file mysql.sock in there... Do I need to move that somewhere else? I realize that this is starting to get off topic for this list... So Maybe I should take this to a mysql list since it looks like php isn't at fault?
I *think* the mysql config file is named: my.cnf so run a slocate or find on your system to see where it is and look at the line:
socket                                          = /var/run/mysqld/mysqld.sock
You can also go into your php.ini file and check out the line: mysql.default_socket = and perhaps setting that to where it is located in your /tmp directory will do the trick... -B As a quick follow up...
the command: $ php -i | grep mysql will spit out info on how php thinks mysql is set up currently... one of the items is: MYSQL_SOCKET => ... So just make sure that is in tune with where the socket really is running -B
-- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424 www.raoset.com japruim@raoset.com --PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#260005) next »