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