在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;
可以查看到所有的用户会发现hadoop并不在user中
返回hive_site.xml中,修改hadoop为hive
再重新执行schematool命令 即可