Re: PHP help question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Feb 13, 2008 10:52 AM, Rudy sleiman <rudy.sleiman@xxxxxxxxx> wrote:
> To whom it may concern
>
> I'm working on a network, i don't have internet access and the
> application i'm working on is not published online.
>
> Platform used: PHP with MySQL.
>
> The Database is created on PC A... I'm working on PC B... and my
> problem is that i am not able to connect to the PC A Database using
> the IP address as a host (since the database is not on my machine).
> but if i'm on PC A i can connect with the localhost.
>
> The question is that: do i need any configuration so i can access the database?

    What error message is being kicked out by PHP when you do
mysql_connect() or mysql_query() with an `or die(mysql_error())`
condition?

    Ensure that the firewall is allowing remote connections to port
3306 on PC A.  If it is, then the problem is likely in the MySQL
internal permissions.  If that's the case, do the following
(substituting your info in place).

    As root (or another authorized user of the database you want to use):
        USE database_name;
        GRANT ALL ON database_name TO database_username@'%' IDENTIFIED
BY 'zxcvbnm';
        FLUSH PRIVELEGES;

    Replace database_name with the name of your database; replace
database_username with a username of your choice (doesn't have to be
an existing account, MySQL will create it on the fly); replace '%'
with the hostname/IP of PC B (using single-quotes around it) or leave
it as '%' (with the quotes) to allow ALL hosts (wildcard); replace
'zxcvbnm' (with quotes) with a password of your choice.

-- 
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux