SQLSyntaxErrorException: DROP command denied to user [email protected] for table weather

今天运营配置天气的时候,抛出异常: java.sql.SQLSyntaxErrorException: DROP command denied to user 'nxengine'@'10.208.2.32' for table 'weather'

原因:dba修改了权限,导致 sql命令:truncate table weather删除天气表中报错;使用delete删除即可;

TRUNCATE TABLE 在功能上与不带 WHERE 子句的 DELETE 语句相同:二者均删除表中的全部行。但 TRUNCATE TABLE 比 DELETE 速度快,且使用的系统和事务日志资源少。

2020-06-01 14:18:18.997 [email protected][hufront-api-6f95585bb8-xq9vj] - [TID:[Ignored Trace]] [http-nio-8081-exec-3] DEBUG c.b.t.h.a.d.s.S.getWeatherConfig - ==> Preparing: SELECT count(*) FROM weather
2020-06-01 14:18:18.997 [email protected][hufront-api-6f95585bb8-xq9vj] - [TID:[Ignored Trace]] [http-nio-8081-exec-3] DEBUG c.b.t.h.a.d.s.S.getWeatherConfig - ==> Parameters:
2020-06-01 14:18:18.998 [email protected][hufront-api-6f95585bb8-xq9vj] - [TID:[Ignored Trace]] [http-nio-8081-exec-3] DEBUG c.b.t.h.a.d.s.S.getWeatherConfig - <== Total: 1
2020-06-01 14:18:18.999 [email protected][hufront-api-6f95585bb8-xq9vj] - [TID:[Ignored Trace]] [http-nio-8081-exec-3] DEBUG c.b.t.h.a.d.s.S.deleteWeatherConfig - ==> Preparing: truncate table weather
2020-06-01 14:18:18.999 [email protected][hufront-api-6f95585bb8-xq9vj] - [TID:[Ignored Trace]] [http-nio-8081-exec-3] DEBUG c.b.t.h.a.d.s.S.deleteWeatherConfig - ==> Parameters:
2020-06-01 14:18:19.003 [email protected][hufront-api-6f95585bb8-xq9vj] - [TID:[Ignored Trace]] [http-nio-8081-exec-3] ERROR c.b.t.b.s.e.GlobalExceptionHandler - ne error
org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: java.sql.SQLSyntaxErrorException: DROP command denied to user 'nxengine'@'10.208.2.32' for table 'weather'
### The error may exist in com/beantechs/tsp/hufront/api/dao/scene/SceneSetDao.xml
### The error may involve defaultParameterMap
### The error occurred while setting parameters
### SQL: truncate table weather
### Cause: java.sql.SQLSyntaxErrorException: DROP command denied to user 'nxengine'@'10.208.2.32' for table 'weather'
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: DROP command denied to user 'nxengine'@'10.208.2.32' for table 'weather'
at org.springframework.jdbc.support.SQLExceptionSubclassTranslator.doTranslate(SQLExceptionSubclassTranslator.java:93)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:72)
at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:81)
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
at com.sun.proxy.$Proxy191.delete(Unknown Source)

 

你可能感兴趣的:(mysql)