+ Reply to Thread
Results 1 to 4 of 4

Thread: Connect to localhost MySQL

  1. #1
    kolodude is offline x10Hosting Member kolodude is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    2

    Exclamation Connect to localhost MySQL

    People have asked questions on how to connect to their domain MySQL database from their localhost. I need it the other way around. I couldn't find the answer to this question anywhere but is there anyway to let the php file that i have uploaded here(tested and works when on localhost) to add data TO MY LOCALHOST mysql server. If yes, could someone please explain how? (i have sqlyog and navicat)

  2. #2
    FengFeng's Avatar
    FengFeng is offline x10Hosting Member FengFeng is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    China,Canton
    Posts
    59

    Re: Connect to localhost MySQL

    can u explain more clearly??
    what u have done and what message do u get?
    do u want to export the date from your own computer,and import the date to the server?

  3. #3
    kajasweb's Avatar
    kajasweb is offline Lord Of The Keys kajasweb is an unknown quantity at this point
    Join Date
    Aug 2007
    Location
    Chennai, India
    Posts
    1,722

    Re: Connect to localhost MySQL

    If you want your PHP files (in X10 Server) to update your MySQL database in your PC. You need to have a mechanism in your PHP script to select the MySQL Server address, just put there your PC IP (You can get your Ip address from http://www.myipaddress.com ) and allow incoming connections from X10 hosting server IP in your PC Firewall. You can get that IP from your account panel. Thats it...
    R. Kaja Mohideen
    Start Your Own Blog... Start Making Money...
    http://www.MyiStop.com/
    CuteCom.Net - Low Cost International Internet Telephony (VoIP) Service

  4. #4
    naim4u's Avatar
    naim4u is offline x10Hosting Member naim4u is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    51

    Re: Connect to localhost MySQL

    Quote Originally Posted by kolodude View Post
    People have asked questions on how to connect to their domain MySQL database from their localhost. I need it the other way around. I couldn't find the answer to this question anywhere but is there anyway to let the php file that i have uploaded here(tested and works when on localhost) to add data TO MY LOCALHOST mysql server. If yes, could someone please explain how? (i have sqlyog and navicat)

    i think this would benice:

    <?php

    define('DBUSER','rootusername');
    define('DBPASS','passwordl');
    define('DBNAME','dbname');
    define('DBHOST','localhost);

    mysql_connect(DBHOST,DBUSER,DBPASS) or die(mysql_error());
    if(!mysql_select_db(DBNAME)){
    echo 'Unable to select database.'.mysql_error();
    exit;
    }

    ?>

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Help please..how do I connect to mysql with sqlyog?
    By bladewarriors in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 10-29-2007, 10:58 AM
  3. Can't Connect to MySQL Server :(
    By adzen in forum Free Hosting
    Replies: 2
    Last Post: 10-18-2007, 09:01 PM
  4. Mysql unable to connect
    By madskillz200 in forum Free Hosting
    Replies: 5
    Last Post: 07-30-2007, 08:11 PM
  5. Have a problem with my forum
    By tikloos in forum Scripts & 3rd Party Apps
    Replies: 43
    Last Post: 01-19-2006, 01:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers