Re: help with mysql connect error
| From: | Stut | Date: | Thu, 08 Feb 2007 16:57:42 +0000 |
| Subject: | Re: help with mysql connect error | ||
| References: | 1 2 3 4 5 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43042@lists.php.net to get a copy of this message | ||
Tim McGeary wrote:
To be run on the command line. Same as a web-based PHP script, but no need to output any HTML. Just write a script that tries to connect to the database and spits out success or failure. Then run php script.php on the command line (CLI === Command Line Interface) and see what happens. -StutPlease include the list in replies.Sorry, I meant to, but hit the wrong button.Tim McGeary wrote:I confess I don't know what at CLI script is. What would I write?Stut wrote:Indeed it should. Have you tried writing a CLI script and seeing if that works?Tim McGeary wrote:Currently mysql.sock is owned by mysql.mysql with S777 permissions. Should the ownership be different? Despite the ownership, wouldn't S777 allow any user to access it?I am new to this list today, so if I should be sending this to another specific PHP list, please let me know. I am getting the following error via the PHP web page I am building:Given that you can connect through the socket on the CLI, I'm gonna guess that it's a permissions issue. Does the user that Apache (or whatever web server you're using) runs as have access to mysql.sock?Warning: mysql_connect(): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) in /var/www/html/software/index.php on line 18 Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)