When hive3.1.2 is initializing, an error message appears: Error: Table 'CTLGS' already exists (state=42S01, code=1050).

Project scenario:

When hive3.1.2 is initializing, an error message appears: Error: Table 'CTLGS' already exists (state=42S01, code=1050).


Problem Description

During the initialization process of hive, the error message Error: Table 'CTLGS' already exists (state=42S01, code=1050) appears.

Insert image description here


Cause Analysis:

The problem here should be that the data tables required by hive already exist in the connected database, like metastore data.


solution:

Go to the database you want to connect to and check if there is a hive database. If so, just delete the hive database and then reinitialize hive.

Insert image description here
Delete hive database

mysql> drop database hive;

Reinitialize hive

[root@cq01 hive]# bin/schematool -initSchema -dbType mysql

The following prompt appears, indicating that the initialization is successful.
Insert image description here

Guess you like

Origin blog.csdn.net/qq_45263520/article/details/124374794