SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict einSTein's Avatar
    Join Date
    Aug 2006
    Posts
    276
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    error "Can't connect to MySQL server" please help me

    i have a big problem my databas on other server on my local network when i try to connect to it by replacing the ip address of the other pc that contains the databsae by by the localhost in the connection string it causes error
    Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on '192.168.1.2' (10060) in C:\xampp\htdocs\ATM\abc.php on line 4

    Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\ATM\abc.php on line 4
    and this is my Code

    PHP Code:
    $host="192.168.1.2";
    $con mysql_connect($host,"root","");
    if (!
    $con)
      {
      die(
    'Could not connect: ' mysql_error());
      }

    mysql_select_db("vbank"$con);

    $result mysql_query("SELECT * FROM client_data");

    while(
    $row mysql_fetch_array($result))
      {
      echo 
    $row['name'] . " " $row['phone'];
      echo 
    "<br />";
      }
    ?> 

  2. #2
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This may not be what you're looking for but.... I used Xampp for years because I didn't know better and... it just completely sucks compared to WampServer2 or Apache2Triad. I wish I had known better a long time ago to never use German software, or at least xampp. I use wamp now on windows now and when I can help it and even better, I use linux.... and I've never been happier with my dev environment.

  3. #3
    reads the ********* Crier silver trophybronze trophy longneck's Avatar
    Join Date
    Feb 2004
    Location
    Tampa, FL (US)
    Posts
    9,854
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    this sounds like a firewall problem. turn off the firewall briefly and see if things improve. if it does, then you need to add a firewall exception.
    Check out our new Industry News forum!
    Keep up-to-date with the latest SP news in the Community Crier

    I edit the SitePoint Podcast


Bookmarks

Posting Permissions

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