Ranger启动失败后,重新安装启动rangeradmin遇到MySQL异常
启动rangeradmin时报错:
SQLException : SQL state: HY000 java.sql.SQLException: Operation CREATE USER failed for ‘rangeradmin’@’%’ ErrorCode: 1396
SQLException : SQL state: HY000 java.sql.SQLException: Operation CREATE USER failed for ‘rangeradmin’@’localhost’ ErrorCode: 1396
SQLException : SQL state: HY000 java.sql.SQLException: Operation CREATE USER failed for ‘rangeradmin’@’node2.domain’ ErrorCode: 1396
经过排查,发现MySQL数据库User中已存在上述用户,执行命令:
delete from user where user=rangeradmin
删除rangeradmin用户后重启rangeradmin仍然报上述错误。
查阅资料之后,发现是MySQL的一个bug:
执行 delete from user where user=rangeradmin 或者drop user ‘rangeradmin ‘@’localhost’ 命令之后要刷新数据库状态,即:
flush privileges
之后重启rangeradmin正常: