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,345
    Thanks
    60
    Thanked 527 Times in 514 Posts
    Blog Entries
    4
    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
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • #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
    •