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 ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| > 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 |
| |||
| 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. |
| |||
| 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. |
| ||||
| 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. > |
| Thread Tools | |
| Display Modes | |
|
|