List:MySQL and Java« Previous MessageNext Message »
From:Pål Arne Hoff Date:March 14 2003 9:25am
Subject:Re: help for my jdbc connection problem
View as plain text  
> 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


Thread
help for my jdbc connection problemLiqiu.Tan14 Mar
  • Re: help for my jdbc connection problemJeff Newmiller14 Mar
    • help for my jdbc connectionShivani17 Mar
      • Re: help for my jdbc connectionMax Morawski17 Mar
  • Re: help for my jdbc connection problemPål Arne Hoff14 Mar