分享

about云日志分析项目准备7-1:mysql HiveUser 授权忘记出现的问题

本帖最后由 pig2 于 2017-4-8 19:32 编辑
问题导读:
1. Hive启动时出现:Access denied for user ... (using password :YES)问题怎么办?



出现问题:

  1. Caused by: java.sql.SQLException: Access denied for user 'hiveUser'@'localhost' (using password: YES)
  2.         at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
  3.         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3970)
  4.         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3906)
  5.         at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:873)
  6.         at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1710)
  7.         at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1226)
  8.         at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253)
  9.         at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284)
  10.         at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083)
  11.         at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806)
  12.         at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
  13.         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  14.         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
  15.         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
  16.         at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
  17.         at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)


复制代码




解决方案:
首先分析,这个问题一定出现在该用户(HiveUser),所以,我们先用该用户,密码登录mysql测试是否成功,

2017-01-17_173246.jpg

登录成功,我们在与配置文件hive-site.xml 中内容比对
  1. <property>
  2. <name>javax.jdo.option.ConnectionUserName</name>
  3. <value>hiveUser</value>
  4. <description>username to use against metastore database</description>
  5. </property>
  6. <property>
  7. <name>javax.jdo.option.ConnectionPassword</name>
  8. <value>hive</value>
  9. <description>password to use against metastore database</description>
  10. </property>
复制代码

用户名:hiveUser
密码:hive
比对相同,所以我们估计问题多数出现在用户授权上,
重新授权,刷新:
  1. grant all privileges on hiveMetada.* to 'hiveUser'@'localhost' identified by 'hive';
  2. flush privileges;
复制代码


重新启动,问题解决

2017-01-17_173746.jpg

没找到任何评论,期待你打破沉寂

关闭

推荐上一条 /2 下一条