Unix Technical Forum

Connecting from a remote computer

This is a discussion on Connecting from a remote computer within the MySQL General forum forums, part of the MySQL category; --> Hi All, This is a dump and simple question but I can't seem to get it to work. How ...


Go Back   Unix Technical Forum > Database Server Software > MySQL > MySQL General forum

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 05:37 AM
Kay C. Tien
 
Posts: n/a
Default Connecting from a remote computer

Hi All,

This is a dump and simple question but I can't seem to get it to
work. How do I enable a user to be able to connect from a remost
host using MySQL Administrator? I added "%" but once signed in, I
still can't access the user panel in the administrator.

Thanks.
Kay


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 05:37 AM
Nuno Vaz Oliveira
 
Posts: n/a
Default Re: Connecting from a remote computer

> Hi All,
>
> This is a dump and simple question but I can't seem to get it to work.
> How do I enable a user to be able to connect from a remost host using
> MySQL Administrator? I added "%" but once signed in, I still can't
> access the user panel in the administrator.
>
> Thanks.
> Kay


I don't know if I can help but MySQL users have some privileges ans one
of the configurations on the privileges of a user is the host from where it
can connect.

If the user is configured to connect only from localhost you won't be able
to connect as that user from a remote machine.

-Nuno


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 05:37 AM
Chris White
 
Posts: n/a
Default Re: Connecting from a remote computer

Just to toss something else in here. A lot of times you have a server
that you can connect to by ssh, but because of firewalls, can't access
mysql through. If you can, however, connect to the database through
ssh, you can do port forwarding. In *nix systems it should be something
like this:

ssh -L 3306:server.com:3306 -N -f user@server.com

This will forward requests from port 3306 locally to port 3306 on
server.com. If you're on windows, you can also do port forwarding
through putty:

http://www.cs.uu.nl/technical/servic...y/puttyfw.html

This becomes pretty easy when you get the hang of it. You can also do like:

ssh -L 3000:server.com:3306 -N -f user@server.com

if you're, say, running a local mysql instance. As a reminder
connections will have to occur to localhost, not the server. Hope this
helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 05:38 AM
Kay C. Tien
 
Posts: n/a
Default Re: Connecting from a remote computer

I got it working perfectly on a Linux server, but my boss wants this
on a Windows IIS server. <sigh>

The remote connection seems to be working now but I have another
problem now... the page is not doing anything - doesn't seem to be
connecting to the database, but I got no error messages
whatsoever. The page just indicated Done on the bottom. The
mysql_connect.php file is listed below. Is there a privilege problem
or is there something else I need to enable?

Much thanks.
Kay

<?php # Script - mysql_connect.php

// This file contains the database access information for the
database. This file also establishes a connection to MySQL and
selects the database.

// Set the database access information as constants.
define ('DB_USER', 'username);
define ('DB_PASSWORD', 'userpass');
define ('DB_HOST', 'localhost');
define ('DB_NAME', 'databasename');

// Make the connnection and then select the database.
$dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could
not connect to MySQL: ' . mysql_error() );
mysql_select_db (DB_NAME) OR die ('Could not select the database: ' .
mysql_error() );

// Function for escaping and trimming form data.
function escape_data ($data) {
global $dbc;
if (ini_get('magic_quotes_gpc')) {
$data = stripslashes($data);
}
return mysql_real_escape_string (trim ($data), $dbc);
} // End of escape_data() function.
?>

At 10:53 AM 1/18/2007 Thursday, Chris White wrote:
>Just to toss something else in here. A lot of times you have a
>server that you can connect to by ssh, but because of firewalls,
>can't access mysql through. If you can, however, connect to the
>database through ssh, you can do port forwarding. In *nix systems
>it should be something like this:
>
>ssh -L 3306:server.com:3306 -N -f user@server.com
>
>This will forward requests from port 3306 locally to port 3306 on
>server.com. If you're on windows, you can also do port forwarding
>through putty:
>
>http://www.cs.uu.nl/technical/servic...y/puttyfw.html
>
>This becomes pretty easy when you get the hang of it. You can also do like:
>
>ssh -L 3000:server.com:3306 -N -f user@server.com
>
>if you're, say, running a local mysql instance. As a reminder
>connections will have to occur to localhost, not the server. Hope this helps.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 05:38 AM
Jerry Schwartz
 
Posts: n/a
Default RE: Connecting from a remote computer

If you have that short a script to test wit, try it from the command line.
Your HTML might be obscuring the error messages.

Regards,

Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington, CT 06032

860.674.8796 / FAX: 860.674.8341


> -----Original Message-----
> From: Kay C. Tien [mailto:kct1986@gmail.com]
> Sent: Thursday, January 18, 2007 4:32 PM
> To: Chris White
> Cc: mysql@lists.mysql.com
> Subject: Re: Connecting from a remote computer
>
> I got it working perfectly on a Linux server, but my boss wants this
> on a Windows IIS server. <sigh>
>
> The remote connection seems to be working now but I have another
> problem now... the page is not doing anything - doesn't seem to be
> connecting to the database, but I got no error messages
> whatsoever. The page just indicated Done on the bottom. The
> mysql_connect.php file is listed below. Is there a privilege problem
> or is there something else I need to enable?
>
> Much thanks.
> Kay
>
> <?php # Script - mysql_connect.php
>
> // This file contains the database access information for the
> database. This file also establishes a connection to MySQL and
> selects the database.
>
> // Set the database access information as constants.
> define ('DB_USER', 'username);
> define ('DB_PASSWORD', 'userpass');
> define ('DB_HOST', 'localhost');
> define ('DB_NAME', 'databasename');
>
> // Make the connnection and then select the database.
> $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could
> not connect to MySQL: ' . mysql_error() );
> mysql_select_db (DB_NAME) OR die ('Could not select the database: ' .
> mysql_error() );
>
> // Function for escaping and trimming form data.
> function escape_data ($data) {
> global $dbc;
> if (ini_get('magic_quotes_gpc')) {
> $data = stripslashes($data);
> }
> return mysql_real_escape_string (trim ($data), $dbc);
> } // End of escape_data() function.
> ?>
>
> At 10:53 AM 1/18/2007 Thursday, Chris White wrote:
> >Just to toss something else in here. A lot of times you have a
> >server that you can connect to by ssh, but because of firewalls,
> >can't access mysql through. If you can, however, connect to the
> >database through ssh, you can do port forwarding. In *nix systems
> >it should be something like this:
> >
> >ssh -L 3306:server.com:3306 -N -f user@server.com
> >
> >This will forward requests from port 3306 locally to port 3306 on
> >server.com. If you're on windows, you can also do port forwarding
> >through putty:
> >
> >http://www.cs.uu.nl/technical/servic...y/puttyfw.html
> >
> >This becomes pretty easy when you get the hang of it. You

> can also do like:
> >
> >ssh -L 3000:server.com:3306 -N -f user@server.com
> >
> >if you're, say, running a local mysql instance. As a reminder
> >connections will have to occur to localhost, not the server.

> Hope this helps.
>




Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 02:35 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com