sql 错误问题

message:
### Error querying database.  Cause: java.sql.SQLSyntaxErrorException: SELECT command denied to user 'root'@'172.20.6.199' for table 't_player'
### The error may exist in com/manage/dao/mapper/IPlayerDataMapper.java (best guess)
### The error may involve com.manage.dao.mapper.IPlayerDataMapper.selectPlayerGameData-Inline
### The error occurred while setting parameters
### SQL: select any_value(server_id) as serverId, any_value(player_id) as userId ,any_value(nickname) as userName,any_value(level) as level,any_value(combat_power) as roleLingLi,any_value(gold) as pantao,any_value(silver) as tongbao from game.t_player where server_id=? and player_id=? or nickname=?;
### Cause: java.sql.SQLSyntaxErrorException: SELECT command denied to user 'root'@'172.20.6.199' for table 't_player'
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: SELECT command denied to user 'root'@'172.20.6.199' for table 't_player'

该错误原因是没有给  game 库授权;所以172.20.6.199 服访  ,报上面错误!

解决方法:

1.授权:

grant all privileges on game.* to 'root'@'172.20.6.199' with grant option;

2.刷新

flush privileges;

原文地址:https://www.cnblogs.com/manager222/p/14468998.html