PDA

View Full Version : Big MySQL Problem!


dylang3893
07-15-2008, 05:45 PM
This has been stressing me out beyond belief.

I'm ready to pull my hair out and throw my laptop across the room!


Okay, so Mac has this feature where there is a Sites folder, and all you have to do is drop an HTML doc into that folder and its published on the web as your IP address (sort of).

It uses apache server, you can enable PHP (which I did) and you have to download MySQL to enable MySQL on that server.

So I downloaded it, it started okay, it created the mysql.sock - however
the big problem is when I go to the site that has PHP to connect to the mysql server, it returns this error:

Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket 'var/tmp/mysqld/mysql.sock' (2) in /Users/omni/Sites/login.php on line 13

(In fact there are 2 more errors almost identical to the one above, you can actually see the site where it shows the errors go to http://192.168.1.3/~omni )

Anyway, I've checked if the server is really running, it is. The mysql.sock file is INDEED in the folder its supposed to be (var/tmp/mysqld) and it still can't connect! I've even edited the php.ini file on Mac to ensure that it goes to that sock file!

The cause is probably permission. As far as I can see from the Finder (similar to windows Explorer) the permissons are on all folders leading to mysql.sock - they allow Everyone to Read&Write, however _mysql user isn't shown on the list, and I can't add it from there. I've heard you need to make the owner of the folder the Mysql account - but how? Every time I use chown on my Terminal it says permission denied!

I need dire help!!

abduraooft
07-15-2008, 06:19 PM
It's likely to be an issue with the host specified in the connection string. The host given in the string might not be active or there might be some typo.

dylang3893
07-15-2008, 06:25 PM
It's likely to be an issue with the host specified in the connection string. The host given in the string might not be active or there might be some typo.

I used localhost
Should I be using something different? And if so how do I find it out?

dylang3893
07-15-2008, 07:43 PM
GREAT!!!

NOW I HAVE ANOTHER ERROR.

PID FILE CANNOT BE FOUND wtf!!!

This is terrible, all mysql is is a bunch of errors! Why bother, I've been through so much stress the last to days I want to kill myself!!

My whole project is gonna go downhill now if I don't get this fixed, I'm gonna go crazy.

EDIT: I fixed this PID FILE error by reinstalling.