这两天项目一直在报这个错误消息:

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: SELECT command denied to user 'xxxxx'@'xxx.xxx.xxx.xxx' for table 'xxxxxx'

at sun.reflect.GeneratedConstructorAccessor54.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2625)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2119)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2283)
at dao.UserDao.getNum(UserDao.java:236)
at dao.UserDao.addUser(UserDao.java:43)
at dao.UserDao.registUser(UserDao.java:160)
at com.unicom.vac.bossagent.soap.SyncNotifySPSoapBindingImp                                                                                    l.orderRelationUpdateNotify(SyncNotifySPSoapBindingImpl.java:31)
at com.unicom.vac.bossagent.soap.SyncNotifySPSoapBindingSke                                                                                    leton.orderRelationUpdateNotify(SyncNotifySPSoapBindingSkeleton.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

在windows 上测试没有问题,可是一移植到到linux上就报这个错了,

解决方案:

将黄色标记的那个账户权限改为全局或是将黄色标记的账户的权限可以select 表(黄色部分标记的表)



评论关闭
IT序号网

微信公众号号:IT虾米 (左侧二维码扫一扫)欢迎添加!

MySql的Communications link failure解决办法