Remote Connection, please help

2002-12-12 Thread Muhammad Salman
I am using the official type 4 mysql driver from
www.mysql.com but unable to make a remote connection
with the mysql database running on our companie's
remote server. I mailed some mailing mailing lists but
didnt find out the right answer yet. I am using the
following code for simple remote connection test: 

Class.forName(org.gjt.mm.mysql.Driver).newInstance();
  Connection con =
DriverManager.getConnection(jdbc:mysql://66.137.7.185:3306/prefill,prefill,jeem);
  out.println(Testing Database Connectivity);
  Statement stmt = con.createStatement();
  ResultSet rs = stmt.executeQuery(select * from
state);
  int i = 0;
  while(rs.next()  i  10)
 {
 out.println(h2 Output: +rs.getString(2) +
/h2);
 i ++;
 }
  rs.close();   
  stmt.close();
  con.close();   

Your quick response will be highly appreciated.



=

Muhammad Salman
Sun Certified Java 2 Programmer
+92214932737 (H)
+923332234828(C 1)
+923332103334(C 2)
Email: [EMAIL PROTECTED]
Text Pager: [EMAIL PROTECTED]
Work Web: http://www.jeemsolutions.com


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Remote Connection, please help

2002-12-12 Thread Peter Vertes
I've never connected your way before.  I'm using J/Connector from the MySQL site 
(http://www.mysql.com/downloads/api-jdbc-stable.html).  That way I have no problems 
connecting.  I do it this way:


// connect to the database
Class.forName(com.mysql.jdbc.Driver);
Connection dbConnection = 
DriverManager.getConnection(jdbc:mysql://localhost/myTable, username, password);

Works like a charm.  Give it a try...

-Pete

-Original Message-
From: Muhammad Salman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 12, 2002 11:36
To: [EMAIL PROTECTED]
Subject: Remote Connection, please help


I am using the official type 4 mysql driver from
www.mysql.com but unable to make a remote connection
with the mysql database running on our companie's
remote server. I mailed some mailing mailing lists but
didnt find out the right answer yet. I am using the
following code for simple remote connection test: 

Class.forName(org.gjt.mm.mysql.Driver).newInstance();
  Connection con =
DriverManager.getConnection(jdbc:mysql://66.137.7.185:3306/prefill,prefill,jeem);
  out.println(Testing Database Connectivity);
  Statement stmt = con.createStatement();
  ResultSet rs = stmt.executeQuery(select * from
state);
  int i = 0;
  while(rs.next()  i  10)
 {
 out.println(h2 Output: +rs.getString(2) +
/h2);
 i ++;
 }
  rs.close();   
  stmt.close();
  con.close();   

Your quick response will be highly appreciated.



=

Muhammad Salman
Sun Certified Java 2 Programmer
+92214932737 (H)
+923332234828(C 1)
+923332103334(C 2)
Email: [EMAIL PROTECTED]
Text Pager: [EMAIL PROTECTED]
Work Web: http://www.jeemsolutions.com


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Remote Connection, please help

2002-12-12 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Muhammad Salman wrote:

I am using the official type 4 mysql driver from
www.mysql.com but unable to make a remote connection
with the mysql database running on our companie's
remote server. I mailed some mailing mailing lists but
didnt find out the right answer yet. I am using the
following code for simple remote connection test: 

Class.forName(org.gjt.mm.mysql.Driver).newInstance();
  Connection con =
DriverManager.getConnection(jdbc:mysql://66.137.7.185:3306/prefill,prefill,jeem);
  out.println(Testing Database Connectivity);
  Statement stmt = con.createStatement();
  ResultSet rs = stmt.executeQuery(select * from
state);
  int i = 0;
  while(rs.next()  i  10)
 {
 out.println(h2 Output: +rs.getString(2) +
/h2);
 i ++;
 }
  rs.close();   
  stmt.close();
  con.close();   

Your quick response will be highly appreciated.


You need to tell us what the error you're receiving is, otherwise we 
can't be of much help.

	-Mark


- -- 
MySQL 2003 Users Conference - http://www.mysql.com/events/uc2003/

For technical support contracts, visit https://order.mysql.com/?ref=mmma

__  ___ ___   __
   /  |/  /_ __/ __/ __ \/ /  Mark Matthews [EMAIL PROTECTED]
  / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Full-Time Developer - JDBC/Java
 /_/  /_/\_, /___/\___\_\___/ Flossmoor (Chicago), IL USA
___/ www.mysql.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE9+MnBtvXNTca6JD8RAkxBAJ9tZD8OF6XByll9AW7IPabqMBZbiQCfdx4g
0lK6FUi8jP331x9czJqqK/E=
=kn1O
-END PGP SIGNATURE-


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



Re: Remote Connection, please help

2002-12-12 Thread Peter T. Abplanalp
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

first a note: this is a topic best discussed on
[EMAIL PROTECTED]

* On Thu, Dec 12, 2002 at 08:35:40AM -0800, Muhammad Salman wrote:
 I am using the official type 4 mysql driver from
 www.mysql.com but unable to make a remote connection
 with the mysql database running on our companie's
 remote server. I mailed some mailing mailing lists but
 didnt find out the right answer yet. I am using the
 following code for simple remote connection test: 
 
 Class.forName(org.gjt.mm.mysql.Driver).newInstance();
   Connection con =
 
DriverManager.getConnection(jdbc:mysql://66.137.7.185:3306/prefill,prefill,jeem);
   out.println(Testing Database Connectivity);
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery(select * from
 state);
   int i = 0;
   while(rs.next()  i  10)
  {
  out.println(h2 Output: +rs.getString(2) +
 /h2);
  i ++;
  }
   rs.close();   
   stmt.close();
   con.close();   

that all looks pretty good.  what error are you getting?
have you checked out the readme that comes with the driver?
it is pretty good at addressing some of the more often run
into problems of this variety.

- -- 
Peter Abplanalp
PGP: pgp.mit.edu
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE9+NFVggA8sH0iRXQRArzMAJwLngnF/ouMCFMEEU846oExQE3H5gCgsrGv
IICJvZ3VPu4+MUtBAKsTAkU=
=NLko
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Remote Connection, please help

2002-12-12 Thread Csongor Fagyal


Subject: Remote Connection, please help


I am using the official type 4 mysql driver from
www.mysql.com but unable to make a remote connection
with the mysql database running on our companie's
remote server. I mailed some mailing mailing lists but
didnt find out the right answer yet. I am using the
following code for simple remote connection test: 

Class.forName(org.gjt.mm.mysql.Driver).newInstance();
 Connection con =
DriverManager.getConnection(jdbc:mysql://66.137.7.185:3306/prefill,prefill,jeem);


Are there no Exceptions thrown?

- Cs.




-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: Remote Connection, please help

2002-12-12 Thread Mark Matthews
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Muhammad Salman wrote:
 Dear Mark, real thanks , Are you refering to this
 issues:

 Issue:

   When I try to connect to the database with MySQL
 Connector/J , I get the
   following exception:


Yes.

[snip]
Thanks Mark for your real quick response. The

error I

am getting is when I try to connect with the

machine's

ip is :

Invalid authorization specification: Access denied

for

user:
'***@**'
(Using password: YES)

But when I connect it with localhost instead of

the ip

I am able to connect to MySQL, by putting the code

on

the same machine. This machine has several

databases

Your permissions are not setup correctly. You need to add GRANTs to 
allow this to happen as it appears that none currently exist that do 
allow it.

You need to do a GRANT [foo] ON [blah] TO 'user'@'host' identified by 
'some_password' to get this to work. I am deliberately leaving out what 
you need to put in for [foo] and [blah], because you _really_ need to 
read the MySQL manual (http://www.mysql.com/doc/en/GRANT.html) and 
understand exactly what you're doing here.

	-Mark
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.1.90 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE9+N9WtvXNTca6JD8RAtpRAJ9+mZRg4gudtabx3yREo2RD+tNj/wCeKuOJ
KeCv39g/Agxk4WG1m0PGFXo=
=LyU/
-END PGP SIGNATURE-


-
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php