hi ,
i'm writing a simple java program that i want to access mysql with.
the error i'm getting is :

"Server configuration denies access to data source" 
the code is :
String url = "jdbc:mysql://localhost:3306/mysql";
                Connection con;
                String query = "SELECT Teacher FROM TimeTable";
                Statement stmt;

                try{ 
                     Class.forName( "org.gjt.mm.mysql.Driver").newInstance();
                    //  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

                }catch(ClassNotFoundException e){
                        System.err.print("ClassNotFoundException: ");
                        System.err.println(e.getMessage());
                }
                catch (Exception E) {
                     System.err.println("Unable to load driver.");
                     E.printStackTrace();
                 }
        
                try{

                        System.out.println("about to ..");
                        con = DriverManager.getConnection(url,"root", "");
                        System.out.println("ok"); 
                        stmt = con.createStatement();


i can connect via command line no problem to mysql. i downloaded the 
mysqlgui form mysql.com and by it will only connect using the UNIX socket 
ie.not the port number alone (3306).
mysqladmin -version says the connection type is UNIX socket, is a tcp 
connection taken for granted or should it say so?
do i have to change some connection parameters to allow connection 
through tcp ports - any suggestions very welcome.
thanks in advance,
kieran
mysql version 10.8 Distrib 3.23.22-beta
mm.mysql.jdbc-1.2c
java1.3
linux 7.0


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