无法更新数据库

时间:2013-01-23 12:47:14

标签: java mysql

我的APP:niaola.cloudfoundry.com java 1.6 mysql5.1

选择代码

     update yy_desklist set isok=? where 
     isok=? and timedrelease<=? Parameters: [1, 0, 1358929049]

错误日志:

      at java.lang.Thread.run(Thread.java:662)
      Caused by: java.sql.SQLException: UPDATE command denied to user 'uHHztgqtQsbK9'@
      '172.30.49.102' for table 'yy_desklist' Query: update yy_desklist set 
       isok=? where isok=? and timedrelease<=? Parameters: [1, 0, 1358929049]
                at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:542)
                at org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:599)
                at com.niaola.yangyun.db.QueryHelper.update(QueryHelper.java:300)
                ... 44 more
      com.niaola.yangyun.db.DBException: java.sql.SQLException: UPDATE command denied
      to user 'uHHztgqtQsbK9'@'172.30.49.102' for table 'yy_desklist' Query: update 
      yy_desklist set isok=? where isok=? and timedrelease<=? 
      Parameters: [1, 0,1358930631] at com.niaola.yangyun.db.QueryHelper.update(QueryHelper.java:302)
      at com.niaola.yangyun.mvc.TempletsClass.getTimedList(TempletsClass.java:57)

1 个答案:

答案 0 :(得分:1)

用户“uHHztgqtQsbK9”似乎没有更新权限。

您需要使用管理员用户授予所需权限。

GRANT  SELECT,INSERT,UPDATE,DELETE ON `db`.* TO 'user'@'host';

有关更详细的说明,请参阅Mysql Documentation - Account Management Statements