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.
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.
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.