[Leaplist] Mysql connection problem

Todd Davenport todd.davenport at yahoo.com
Tue Apr 15 20:32:10 EDT 2008


Also, remember that from the command line you are
connecting the the mysql server as whoever you are
logged in as, whereas if you are using Apache the
client is trying to connect as whatever user your
httpd process is running as (you can quickly determine
this by running "ps -auxwww|more" or some variant
thereof, or checking your httpd.conf file).

You can probably quickly check this by connecting to
the mysql server from the command line client as the
Apache user. (i.e. use the "-u" command line options,
such as "mysql -u httpd -p ****").

This was a frequent "gotcha" for me.

~Todd
 
 
> Message: 1
> Date: Sat, 12 Apr 2008 08:25:18 -0400
> From: "Mark W. Alexander" <slash at dotnetslash.net>
> Subject: Re: [Leaplist] Mysql connection problem
> To: leaplist at leap-cf.org
> Message-ID: <20080412122518.GA18122 at dotnetslash.net>
> Content-Type: text/plain; charset=us-ascii
> 
> On Fri, Apr 11, 2008 at 02:39:02AM +0530, Deepan
> wrote:
> > Hi All,
> > I am able to connect to Mysql via command line
> > using mysql client. I am also able to connect to
> > mysql via php if I run those php programs via
> > command line. However when I hit those php pages
> > via the browser it throws the error Can't connect
> > to local MySQL server through socket
> > '/tmp/mysql.sock' (2). Please note that this is
> > the same socket the mysql client tries to connect
> > to the server.
> 
> Have you checked ownership and permissions on
> /tmp/mysql.sock? In order
>  for
> "pages" to access MySQL, the web server (I assume
> apache) needs to be
>  able to
> access the socket.
> 
> mwa
> -- 
> Mark W. Alexander
> slash at dotnetslash.net
> 
> The contents of this message authored by Mark W.
> Alexander are released
>  under
> the Creative Commons Attribution-NonCommercial
> license.  Copyright of
>  quoted
> materials, if any, are retained by the original
> author(s).
> 
> http://creativecommons.org/licenses/by-nc/2.0/
> 
> 
> 
> 
>      
>



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


More information about the Leaplist mailing list