Jump to content


Photo

Remote MySql


  • Please log in to reply
1 reply to this topic

#1 Xeon-YK

Xeon-YK
  • Members
  • PipPip
  • Member
  • 10 posts

Posted 27 March 2006 - 07:13 AM

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


#2 wickning1

wickning1
  • Members
  • PipPipPip
  • Advanced Member
  • 405 posts

Posted 27 March 2006 - 08:13 AM

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]




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users