Connect to localhost MySQL

kolodude

New Member
Messages
2
Reaction score
0
Points
0
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)
 

FengFeng

New Member
Messages
59
Reaction score
0
Points
0
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?
 

kajasweb

New Member
Messages
1,723
Reaction score
0
Points
0
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...
 

naim4u

New Member
Messages
51
Reaction score
0
Points
0
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;
}

?>
 
Top