欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

【Hive】Causedby:MetaException(message:Hivemetastoredatabaseisnotinitialized.Pleas

程序员文章站 2022-06-22 19:14:39
启动Hive报错如下: Caused by: MetaException(message:Hive metastore database is not initialized. Please...

启动Hive报错如下:

Caused by: MetaException(message:Hive metastore database is not initialized. Please use schematool (e.g. ./schematool -initSchema -dbType ...) to create the schema. If needed, don't forget to include the option to auto-create the underlying database in your JDBC connection string (e.g. ?createDatabaseIfNotExist=true for mysql))

从报错原因可以看出,没有初始化,需要在Hive安装目录的bin目录下面执行:

./schematool -initSchema -dbTypemysql(根据实际安装的数据库改写,因为安装的是mysql,所以我在此处填写的mysql)。

查找schematool文件目录方式:

su - root

find / -name schematool