Re: Can't Connect to MySQL local Server
| From: | ROGER DEBRY | Date: | Fri, 27 Oct 2006 16:42:42 +0000 |
| Subject: | Re: Can't Connect to MySQL local Server | ||
| References: | 1 2 3 4 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-42610@lists.php.net to get a copy of this message | ||
skip-networking is uncommented in the [mysqld] section of my.cnf
I did discover something interesting this morning.
When starting the MySQL server with mysqld_safe,
I cannot connect to the server with my php script.
However, I started the server this morning with /etc/init.d/mysqld start,
and the php script connects just fine.
Can anyone tell me why the difference?
>>> "Matteo Cisilino" <matteo@cisilino.com> 10/27/2006 9:15 AM >>>
Alle 16:36, venerdì 27 ottobre 2006, ROGER DEBRY ha scritto:
check if your mysql daemon doesn't skip networking
> Some further information/questions on this problem.
>
> I wrote a small program just to see if I could connect to the mysql
> socket, and I could.
> Looking at seliunx policy, I note an item called "Allow HTTPD scripts
> to and modules to connect to the network."
> That item is unchecked. Should it be checked in order for the php
> script to connect using a socket?
>
> >>> "Chris" <dmagick@gmail.com> 10/26/2006 5:33 PM >>>
>
> ROGER DEBRY wrote:
> > Janet and Miles, Thank you for your suggestions.
> >
> > Here is more information for you.
> > I am running:
> > Fedora core 5 Linux
> > php 5.14
> > apache 2.2.2
> > mysql 5.0.22
> >
> > I have added the mysql_error code to my script as you suggested.
> > I already knew the what the error was by looking in the error logs.
> > It is, "Can't connect to local MySQL server through socket
> > '/var/lib/mysql/mysql.sock' (13)"
>
> That means 'permission denied'.
>
> Are you sure mysql is running on "localhost" ?
>
> FC5 has "selinux" doesn't it - make sure permissions are set up
> properly
> for that too.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php