Hi,
I'm connecting to a MySQL server through the MM JDBC driver on under Red Hat
6.2 using the below code. I keep getting an error message returned that says
: "Server configuration denies access to data ". 
I'm connecting as the root user and I am definitely passing the correct
password etc. in the url I send to the driver. The URL I'm using is :
jdbc:mysql://localhost:3306//test. Can anyone suggest a solution to this
problem please ? 
I have another server which is running WIN2K that I can connect to just fine
and both servers were set up in similar ways.
I thought that perhaps I would need to setup the host table in mysql, but
that did not provide any useful results.
 I just can't figure it out. Thanks you in advance for any information, 
Regards,
Todd G. Nist
Email:   [EMAIL PROTECTED]


code:  

import java.sql.*;

public class mysqltest
{
    Connection Conn = null;
    ResultSet RS = null;
    Statement Stmt = null;

    static String DBUrl = null;
    public static void main(String[] args) throws Exception {
            DBUrl = args[0];
            mysqltest T = new mysqltest();
    }

    public mysqltest() throws Exception {
          try {
            System.out.println("preparing to conntect to datasource: " +
DBUrl);
            Class.forName("org.gjt.mm.mysql.Driver").newInstance();
            Conn = DriverManager.getConnection(DBUrl);
            Stmt = Conn.createStatement();
            System.out.println("got connection");
            System.out.println("Selecting Rows");

            RS = Stmt.executeQuery("SELECT * FROM user");
            
            System.out.println("Positioning before start of result set");

            RS.beforeFirst();

            System.out.print("going forward through results: ");

            while (RS.next()) {
                    String s = RS.getString("FirstName") + " " +
RS.getString("LastName");
                    System.out.println(s);
                }

          } catch (SQLException E) {
            throw E;
          }
          finally {
            if (RS != null) {
                   try {
                     RS.close();
                   } catch (SQLException SQLE) {}
            }
            
            if (Stmt != null) {
                    try {
                      Stmt.close();
                    }   catch (SQLException SQLE) {}
            }
 
            if (Conn != null) {
                    try {
                      Conn.close();
                    } catch (SQLException SQLE) {}
            }
         }
        }
}






The information in this electronic mail ("e-mail") message may
be confidential and for use of only the named recipient.  The
information may be protected by privilege, work product immunity
or other applicable law.  If you are not the intended recipient
the retention, dissemination, distribution or copying of this
e-mail message is strictly prohibited.  If you receive this e-mail
message in error please notify us immediately by telephone
at 770-723-1011 or [EMAIL PROTECTED]  Thank you. 



---------------------------------------------------------------------
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

Reply via email to