From: Date: March 14 2003 9:25am Subject: Re: help for my jdbc connection problem List-Archive: http://lists.mysql.com/java/5199 Message-Id: <3E7191F5.3080109@hoff.ol.no> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit > My system is Redhat 8.0 + Java 1.4.0.3 + Mysql 3.23.55. > My /etc/hosts file is : > "127.0.0.1 localhost localhost > 192.168.0.14 hy > " > also ,192.168.0.14 is the ip address of localhost. > > if my connection url is "jdbc:mysql://192.168.0.14:3306/data" it works > fine. > if my connection changed to "jdbc:mysql://localhost:3306/data" or > "jdbc:mysql://127.0.0.1:3306/data" , it throws the following error: > " > java.sql.SQLException: Server configuration denies access to data source > at org.gjt.mm.mysql.MysqlIO.init(Unknown Source) > at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source) > at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source) > at org.gjt.mm.mysql.Driver.connect(Unknown Source) > at java.sql.DriverManager.getConnection(DriverManager.java:512) > at java.sql.DriverManager.getConnection(DriverManager.java:171) > at JdbcTest24.main(JdbcTest24.java:11) > " > > What is my problem? Thanks. > You need to grant the same kind of access to "localhost" (or maybe you need to use the ip-adresse when granting the access. I'm not sure) as you have done to "hy" inside MySQL. Cheers, Pål Arne Hoff