List:General Discussion« Previous MessageNext Message »
From:Christian Mack Date:March 11 1999 1:10pm
Subject:Re: Access denied
View as plain text  
Asterix wrote:
> 
> Hi,
> I am writing a program that use JDBC to access mysql database.
> However, when I run the program I have this following error :
> 
> General error: Access denied for user: '@tools1' to database 'HONGKONG'
> java.sql.SQLException: General error: Access denied for user: '@tools1' to
> database 'HONGKONG'
>         at org.gjt.mm.mysql.MysqlIO.sendCommand(MysqlIO.java)
>         at org.gjt.mm.mysql.MysqlIO.sqlQuery(MysqlIO.java)
>         at org.gjt.mm.mysql.Connection.execSQL(Connection.java)
>         at org.gjt.mm.mysql.Statement.executeQuery(Statement.java)
>         at testc.StockSlave.readRecord(StockSlave.java:157)
>         at testc.StockSlave.doJob(StockSlave.java:105)
>         at testc.StockSlave$1.onArrival(StockSlave.java:60)
> 
> I think I have a privilege problem.
> I did flush the privilege in mysql:
> 
> % mysql -uroot mysql
> mysql> flush privileges;
> % mysqladmin -uroot reload
> 
> I also tried:
> 
> % mysql -uroot mysql
> mysql> insert into user values ('tools1','%', '', 'Y', 'Y', 'Y', 'Y', 'Y', 'Y',
> 'Y', 'Y', 'Y', 'Y');
> ERROR 1136: Column count doesn't match value count at row 1
> 
> Does anybody can help me solve this problem?
> How can I allow any user from specific host to access mysql w/o submitting
> their username and password?
> 
> Thank you very much.
> Regards,
> 
> AJI

Hi AJI

First: I think you didn't give an user name to the driver.
You should provide your Java source code with the getConnection(...) thing.
With this we can help you.

Second: Don't give '%' for column mysql.user.User use '' (= empty string) instead.

Third: The error message indicates, that you are not using a current 3.22.xx mysql
database. Please give us the version you use.

Tschau
Christian

Thread
Access deniedAsterix11 Mar
  • Re: Access deniedChristian Mack11 Mar
  • Re: Can mysql handle this load?nospam9 Jul
  • RE: Can mysql handle this load?Andy Eastham9 Jul
  • Re: Can mysql handle this load?Krasimir_Slaveykov10 Jul
  • Left Join - Revistedvernon10 Jul
RE: Can mysql handle this load?Mike Hillyer9 Jul
RE: Can mysql handle this load?Rudy Metzger9 Jul
RE: Can mysql handle this load?Rudy Metzger9 Jul
RE: Can mysql handle this load?Rudy Metzger9 Jul
RE: order of table joins or where clauses relevant?Rudy Metzger10 Jul
RE: Left Join - RevistedRudy Metzger11 Jul
RE: Can mysql handle this load?Rudy Metzger14 Jul