Free Web Hosting Forum
Go Back   Free Web Hosting Forum > Website Building > Web Programming
Reload this Page remote mysql access from my home webserver
Reply
 
Thread Tools Display Modes
(#1 (permalink))
Old
Junior Member
vecchiounno is on a distinguished road
 
Posts: 5
Join Date: Jun 2009
Default remote mysql access from my home webserver - 06-27-2009, 04:09 PM

i have a premium account and the helpdesk isnt able to solve my problem

the final goal is to connect to remote mysql from my client (in VB.NET) into my pc, but first i want test with a STANDARD php script....


my ip on hosting24.com is 174.36.100.112

Code:
<?PHP
$db_server = mysql_connect('174.36.100.112','my db user','my db password');
if ($db_server){
	print "SERVER ok";
	$db_selez = mysql_select_db('my db name', $db_server);
	if ($db_selez){
		print "DB ok";
		$utente = mysql_query("SELECT * FROM users WHERE username = 'admin'", $db_server);
		if ($utente){
			while ($rec = mysql_fetch_array($utente)){
				$nome = $rec[3];
			}
			print $nome;
		}else{
			print "NO TABLE";
		}
	}else{
		die("Couldn't select database: ".mysql_error());
	}
}else{
	die ("Couldn't connect to server.");
}
?>

the connection to server it's OK
but the connection to my db NO...

HELP PLS!
Reply With Quote
(#2 (permalink))
Old
sizzlefire's Avatar
Administrator
sizzlefire is on a distinguished road
 
Posts: 4,530
Join Date: Apr 2008
Send a message via AIM to sizzlefire Send a message via MSN to sizzlefire Send a message via Yahoo to sizzlefire Send a message via Skype™ to sizzlefire
Default 06-27-2009, 04:16 PM

Did you add your IP in cPanel?
Reply With Quote
(#3 (permalink))
Old
Bad Karma[CORE]'s Avatar
Direct Admin
Bad Karma[CORE] is on a distinguished road
 
Posts: 5,924
Join Date: May 2008
Default 06-27-2009, 04:17 PM

are you sure about the IP address?
And has remote mysql access been enabled in your cPanel?
Reply With Quote
(#4 (permalink))
Old
Junior Member
vecchiounno is on a distinguished road
 
Posts: 5
Join Date: Jun 2009
Default 06-27-2009, 04:20 PM

in remote access i have add % for all hosts

this IP 174.36.100.112 is reported in cpanel as "Dedicated Ip Address"
Reply With Quote
(#5 (permalink))
Old
sizzlefire's Avatar
Administrator
sizzlefire is on a distinguished road
 
Posts: 4,530
Join Date: Apr 2008
Send a message via AIM to sizzlefire Send a message via MSN to sizzlefire Send a message via Yahoo to sizzlefire Send a message via Skype™ to sizzlefire
Default 06-27-2009, 04:22 PM

Quote:
Originally Posted by vecchiounno View Post
in remote access i have add % for all hosts

this IP 174.36.100.112 is reported in cpanel as "Dedicated Ip Address"
No, you just have to add your computers IP address, http://findmyip.com
Reply With Quote
(#6 (permalink))
Old
Junior Member
vecchiounno is on a distinguished road
 
Posts: 5
Join Date: Jun 2009
Default 06-27-2009, 04:32 PM

but i want that all my customers can connect from remote
(i dont change or add anytime a new ip...)

p.s.
i'm a router at lan home
Reply With Quote
(#7 (permalink))
Old
Junior Member
vecchiounno is on a distinguished road
 
Posts: 5
Join Date: Jun 2009
Default 06-27-2009, 04:51 PM

this the result of php script

SERVER ok
Couldn't select database: Access denied for user 'scgmlegi_scgm'@'87.8.70.173' to database 'scgmlegi_scgm'
Reply With Quote
(#8 (permalink))
Old
Junior Member
vecchiounno is on a distinguished road
 
Posts: 5
Join Date: Jun 2009
Default 06-27-2009, 05:12 PM

ok
I have solved with php
I had not added the privilege to the user (sorry), but only create the user...

Now i try in VB.NET...
Reply With Quote
(#9 (permalink))
Old
chanh's Avatar
Administrator
chanh is on a distinguished road
 
Posts: 1,850
Join Date: Dec 2008
Default 06-27-2009, 06:40 PM

I don't understand why you would want to open up your site for remote attack to your database.
Reply With Quote
(#10 (permalink))
Old
sizzlefire's Avatar
Administrator
sizzlefire is on a distinguished road
 
Posts: 4,530
Join Date: Apr 2008
Send a message via AIM to sizzlefire Send a message via MSN to sizzlefire Send a message via Yahoo to sizzlefire Send a message via Skype™ to sizzlefire
Default 06-28-2009, 06:06 AM

Quote:
Originally Posted by chanh View Post
I don't understand why you would want to open up your site for remote attack to your database.
He just wanted to open it up so him and all his customers could access it, it many not be the best idea, but as long as you don't have many enemies you should be fine xD
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.5.2
vBulletin Skin developed by: vBStyles.com