show databases;
FAILED: SemanticException org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
mysql中
grant all privileges on *.* to 'root'@'%' identified by '111111' with grant option;
grant all privileges on *.* to 'root'@'master' identified by '111111' with grant option;
flush privileges;
在hive的配置文件hive-site.xml添加如下配置:
<property>
<name>datanucleus.schema.autoCreateAll</name>
<value>true</value>
</property>
然后删除MySQL中原来的表,重新初始化元数据
mysql -u root -p
drop database hive_metastore;
create database hive_metastore;
初始化元数据:schematool -dbType mysql -initSchema
hive 的bin目录下:hive --service metastore &
重启hive