Daniel Lacal wrote:
>
> I'm trying to connect from a machine(machine1) of my server to another machine
> (machine2). I have this program made in php3 and I' m using this:
>
> $Conexion=mysql_connect("localhost","root");
> and it works fine.
> I think that if I want to connect to the database put in the machine2 I should do:
>
> $Conexion=mysql_connect("machine2","root","password"); (*)
> using this I can't connect I recive this error:
>
> Warning: Can't connect to MySQL server on machine2 (111) in /......./Entrada.php3
> bon line 8
>
> (*) I've used root as user root of the machine and password, the password of the user
> root.
>
> What's wrong there???????
>
> Thank you
>
> Daniel Lacal (d_lacal@stripped)
Hi Daniel
1) Is mysqld running on machine2? (I know it sounds stupid, but this one catched me too :)
2) Your machine user/password pair has absolutely nothing to do with mysql's user/password
pair! Therefore check, if these are valid entries in the mysql.user table of machine2!
3) If a mysql user 'root' with password 'password' is defined in table mysql.user on
machine2, check if this user is allowed to connect from machine1 (== is 'machine1' listed
as mysql.user.Host?)!
4) Can you connect with 'machine2.yourdomain.com' or IP-address instead of 'machine2' ?
Hope this helps
Christian
| Thread |
|---|
| • remote connection | Daniel Lacal | 1 Jun |
| • Re: remote connection | Christian Mack | 1 Jun |