List:MySQL and PHP« Previous Message
From:Michel Belleau Date:December 4 2009 2:58pm
Subject:RE: connect error
View as plain text  
Hi,

Can you try connecting from the command-line using the mysql client
binary, using "localhost" and using "192.168.0.1" as the "-h" parameter?
If the client can't connect, PHP won't be more able.

Can you connect from another machine in the 192.168.0.1 subnet, using
the mysql client binary? If not, are you sure to be using the correct IP
address for the server?

Michel


Le vendredi 04 décembre 2009 à 06:35 +0000, gwahir hotmail a écrit :

> thanks
>  
> but
>  
>  
> sockstat | grep mysql
>  
> mysql    mysqld     1634  10 tcp4   *:3306                *:*
> mysql    mysqld     1634  12 stream /tmp/mysql.sock
> 
> the problem is " from this php/mysqlclient" i can't connect via tcp
>  
> freak, freak
>  
>  
>  
> > Subject: Re: connect error
> > From: michel.belleau@stripped
> > To: gwahir@stripped
> > CC: php@stripped
> > Date: Thu, 3 Dec 2009 13:10:53 -0500
> > 
> > Hi Gwahir,
> > 
> > IMHO, this problem is not related to PHP, but to your MySQL server
> > configuration.
> > You should have a look at your MySQL server configuration.
> > Most distribution comes with a default "secure" installation:
> > 
> > 
> > mbelleau@laptop:~$ cat /etc/mysql/my.cnf | grep bind
> > bind-address = 127.0.0.1
> > 
> > 
> > You can change 127.0.0.1 to 0.0.0.0 and then restart MySQL and you
> > should be fine.
> > 
> > The first thing you should have a look at is how the daemon process
> is
> > binding to a specific IP address with netstat:
> > 
> > 
> > mbelleau@laptop:~$ sudo netstat -anp | grep mysql | grep ^tcp
> > tcp 0 0 127.0.0.1:3306 0.0.0.0:*
> > LISTEN 2968/mysqld 
> > 
> > 
> > If the process only listens to 127.0.0.1 (localhost), it won't
> accept
> > connections from any other IP address.
> > 
> > Michel
> > 
> > Le jeudi 03 décembre 2009 à 17:31 +0000, gwahir hotmail a
> écrit :
> > 
> > > hello guys i've a problem that i'm going crazy
> > > 
> > > 
> > > 
> > > machine freebsd 7.2 (192.168.0.1)
> > > 
> > > php 5.2
> > > 
> > > mysql 5.1
> > > 
> > > 
> > > 
> > > 
> > > 
> > > if i do 
> > > 
> > > 
> > > 
> > > $link = mysql_connect ("localhost",user,password)
> > > 
> > > 
> > > 
> > > i connect perfectly
> > > 
> > > 
> > > 
> > > but if i do
> > > 
> > > 
> > > 
> > > $link = mysql_connect ("192.168.0.1",user,password)
> > > 
> > > 
> > > 
> > > 
> > > 
> > > i get "Can't connect to Mysql on '192.168.0.1' (0)" 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > localhost and 192.168.0.1 are the same machine
> > > 
> > > 
> > > 
> > > 
> > > 
> > > i've this two grants
> > > 
> > > 
> > > 
> > > 
> > > 
> > > grant all on *.* to user@localhost identified by 'password'
> > > 
> > > grant all on *.* to user@stripped identified by 'password'
> > > 
> > > 
> > > 
> > > 
> > > 
> > > help please i'm going CRAZY
> > > 
> > > 
> > > 
> > > 
> > > 
> > > _________________________________________________________________
> > > Deja que Sietes te enseñe todo los secretos de Windows
> > > http://www.sietesunpueblodeexpertos.com/
> 
> 
> ______________________________________________________________________
> Date una vuelta por Sietes y conoce el pueblo de los expertos en
> Windows 7

Thread
connect errorgwahir hotmail3 Dec
  • Re: connect errorNils Meyer3 Dec
    • RE: connect errorgwahir hotmail3 Dec
  • Re: connect errorMichel Belleau3 Dec
    • RE: connect errorgwahir hotmail4 Dec
      • RE: connect errorMichel Belleau4 Dec