Jump to content

Archived

This topic is now archived and is closed to further replies.

Xeon-YK

Remote MySql

Recommended Posts

hi..., i wan't to ask how to remote to mysql
i have make a php application and i want to use mysql for the database in different computer, the computer ip is 10.20.37.77 and mysql port 3306, the password = "root"

here is the code

$MySQL_Username = "root";
$MySQL_Host = "10.20.37.77";
$MySQL_Passwd = "root" ;
$MySQL_DB = "squid";
$db = mysql_connect( $MySQL_Host , $MySQL_Username , $MySQL_Passwd ) ;

the error :
Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'xeon' (using password: NO) in D:\Program

if the php application use mysql in localhost it work
$MySQL_Username = "root";
$MySQL_Host = "localhost";
$MySQL_Passwd = "" ;
$MySQL_DB = "squid";
$db = mysql_connect( $MySQL_Host , $MySQL_Username , $MySQL_Passwd ) ;

please help me, thank you

Share this post


Link to post
Share on other sites
MySQL has a permissions structure of its own. You have to create a user root@xeon and give it permission to access data.

[a href=\"http://dev.mysql.com/doc/refman/4.1/en/adding-users.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/4.1/en/adding-users.html[/a]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.