hive使用schematool初始化,出错Failed to get schema version;Access denied for user 'hadoop'@'localhost' (usin

在hive安装完成使用schematool初始化的时候,老是报了两个错

1,Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

解决方法:打开 hive_site.xml文件,把`com.mysql.jdbc.Driver改成`com.mysql.cj.jdbc.Driver

2,第一个错解决后,又出现了一个问题:org.apache.hadoop.hive.metastore.HiveMetaException: Failed to get schema version.
Underlying cause: java.sql.SQLException : Access denied for user 'hadoop'@'localhost' (using password: YES)

解决方法:打开sql,在sql里输入命令select user,host from mysql.user;

hive使用schematool初始化,出错Failed to get schema version;Access denied for user 'hadoop'@'localhost' (usin_第1张图片

可以查看到所有的用户会发现hadoop并不在user中

返回hive_site.xml中,修改hadoop为hive

再重新执行schematool命令 即可

hive使用schematool初始化,出错Failed to get schema version;Access denied for user 'hadoop'@'localhost' (usin_第2张图片

 

你可能感兴趣的:(hive使用schematool初始化,出错Failed to get schema version;Access denied for user 'hadoop'@'localhost' (usin)