0

Thanks in advance.

I have Installed WAMP Server on System 4(192.168.1.104). I can Connect MySql DB from System 4 Local host.

//Code:
if (!mysql_connect('localhost','root', '')){
    die('Could not connect: ' . mysql_error());
}

The Connection is working Fine.

Now i am trying to Connect System 4 Database From Another Machine.

//Code:
if (!mysql_connect('192.168.1.104','root', '')){
    die('Could not connect: ' . mysql_error());
}

i am receiving This Error in Browser

Warning: mysql_connect() [function.mysql-connect]: Host 'Laptop' is not allowed to connect to this MySQL server in D:\xampp\htdocs\bigben_new\testDB.php on line 7 Could not connect: Host 'Laptop' is not allowed to connect to this MySQL server

Please Give a solution. and thanks in Advance.

rkaartikeyan
  • 1,977
  • 9
  • 29
  • 57
  • Use [`GRANT`](http://dev.mysql.com/doc/refman/5.1/en/grant.html) like `GRANT ALL ON TO *.* 'remoteuser'@'yourotherhost' IDENTIFIED BY 'password'` - and don't forget to `FLUSH PRIVILEGES` afterwards. You could use `root` but I wouldn't do that. – vstm Dec 30 '11 at 09:35

2 Answers2

3

You have to allow access to your phpMyAdmin on '192.168.1.104' from '192.168.1.5' or from all 127.0.0.1

You can refer below post.

how to give access of PhpMyAdmin

1

Simple:

GRANT USAGE ON *.* TO rkaartikeyan@192.168.1.104 IDENTIFIED BY 'rkaartikeyanpasswd';
GTodorov
  • 1,993
  • 21
  • 24