Unable to create or use hive database getting permission denied error

The reason for this is we have removed write permissions to default warehouse directory of the hive. As some users are deleting data of this hive default directory which is impacting other users.

So in order to use hive we have to create our own hive warehouse directory after launching hive cli. Create our own database.

set hive.metastore.warehouse.dir=/user/Your_Username/warehouse;
CREATE DATABASE IF NOT EXISTS Your_Username_Your_databasename;
USE Your_Username_Your_databasename;

Note: Please don’t forget to replace Your_Username with your labs user name & Your_Username_Your_databasename with required database name.

You can link for related YouTube video & this link for medium post.

1 Like