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/