Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Dec 2007
    Posts
    269
    Thanks
    28
    Thanked 0 Times in 0 Posts

    connection problem to other pc in local

    my ip is 192.168.2.231

    my codes
    PHP Code:
    $link mysql_connect("192.168.2.21","root","123456");

    if(!
    $link){
        echo 
    mysql_errno().":"mysql_error();

    i m getting following error

    Code:
    Warning: mysql_connect() [function.mysql-connect]: Host '192.168.2.231' is not allowed to connect to this MySQL server in D:\xampp\htdocs\tekoser\x.php on line 24
    1130:Host '192.168.2.231' is not allowed to connect to this MySQL server

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,476
    Thanks
    63
    Thanked 538 Times in 525 Posts
    A quick google of "mysql restrict ip" turned up some interesting comments.

    It appears you may need to grant each user the privilege of @<ip>


    Linky
    I can't really think of anything to write here now...

  • #3
    12k
    12k is offline
    New Coder
    Join Date
    Jan 2012
    Posts
    29
    Thanks
    0
    Thanked 6 Times in 6 Posts
    Yupp, that is correct. There are also other ways, but I don't recommend them as they allow WAN connections to mysql which i strongly discourage.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •