SELECT command denied to user

 

root cause

org.hibernate.exception.SQLGrammarException: could not execute query

************

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: SELECT command denied to user 'databasename'@'127.0.0.1' for table

原因与解决:

    因为Hibernate Tools(或者Eclipse本身的Database Explorer)生成*.hbn.xml工具中包含有catalog="databasename"(*表示数据库名称)这样的属性,将该属性删除就可以了.

你可能感兴趣的:(SELECT command denied to user)