SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory] Metastore connection URL: jdbc:mysql://localhost:3306/hive?serverTimezone=UTC Metastore Connection Driver : com.mysql.cj.jdbc.Driver Metastore connection User: APP org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version. Underlying cause: java.sql.SQLException : Access denied for user 'APP'@'localhost' (using password: YES) SQL Error code: 1045
时间: 2024-02-17 19:03:18 浏览: 23
这个错误提示表明Hive在连接MySQL数据库时认证失败,因为用户APP在localhost上使用给定密码被拒绝了。
建议检查MySQL数据库中APP用户是否存在,并且使用的密码是否正确。可以在MySQL数据库中使用以下命令查看用户信息:
```
mysql> SELECT user, host, password FROM mysql.user WHERE user = 'APP';
```
如果密码不正确,可以在MySQL数据库中使用以下命令修改密码:
```
mysql> ALTER USER 'APP'@'localhost' IDENTIFIED BY 'new_password';
```
如果用户不存在,可以在MySQL数据库中使用以下命令创建用户:
```
mysql> CREATE USER 'APP'@'localhost' IDENTIFIED BY 'password';
```
如果还有问题,请检查MySQL数据库的配置是否正确,并确保MySQL数据库已经正常启动。
相关问题
slf4j: actual binding is of type [org.apache.logging.slf4j.log4jloggerfactory]
这个是一个日志相关的提示,意思是SLF4J(Simple Logging Facade for Java)使用的实际绑定方式是org.apache.logging.slf4j.Log4jLoggerFactory。
上述所给代码出错,显示SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/D:/apache-maven-3.6.1/maven_repository/org/slf4j/slf4j-reload4j/1.7.36/slf4j-reload4j-1.7.36.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/D:/apache-maven-3.6.1/maven_repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Reload4jLoggerFactory] log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at WordCountTest.SortNumbers.main(SortNumbers.java:48)
这个错误是因为项目中引入了多个 SLF4J 绑定,造成了冲突。可以通过在项目的 pom.xml 文件中排除其中一个冲突的依赖来解决此问题。例如,如果你想排除 slf4j-log4j12 的依赖,可以按照以下方式操作:
```
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.7.1</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
</exclusions>
</dependency>
```
在排除依赖后,重新编译和运行程序,就可以避免上述错误了。此外,log4j:WARN No appenders could be found for logger 的警告信息可能是因为没有正确配置 log4j,可以参考警告信息中提供的链接来了解如何配置 log4j。最后,java.lang.ArrayIndexOutOfBoundsException 错误可能是因为程序中访问了数组的越界元素,需要检查程序中的数组访问代码是否正确。