No USAGE permission on database

User does not have USAGE permission on the database.

Written by rakesh.parija

Last published at: May 31st, 2022

Problem

You are using a cluster running Databricks Runtime 7.3 LTS and above.

You have enabled table access control for your workspace (AWS | Azure | GCP) as the admin user, and granted the SELECT privilege to a standard user-group that needs to access the tables.

A user tries to access an object in the database and gets a SecurityException error message.

Error in SQL statement: SecurityException: User does not have permission USAGE on database <databasename>

Cause

A new USAGE privilege was added to the available data access privileges. This privilege is enforced on clusters running Databricks Runtime 7.3 LTS and above.

Solution

Grant the USAGE privilege to the user-group.

  1. Login to the workspace as an admin user.
  2. Open a notebook.
  3. Run the following command:
    %sql
    
    GRANT USAGE ON DATABASE <databasename> TO <user-group>;

Review the USAGE privilege (AWS | Azure | GCP) documentation for more information.