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!!
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!!