<@U0A71G31CDV> I'm using shared storage and a stor...
# questions-and-troubleshooting
g
@Rocky I'm using shared storage and a storage volume for my DBs. I create users & grant them the ALL grant type on the database they need to manage, but it looks like it is not sufficient for them to be able to create tables in the DB. My LLM suggests I need to add "USAGE" to the storage volume for that user. Is it true?
r
Yes, your LLM is correct. In a StarRocks shared-data cluster, granting
ALL
on a database is not enough for a user to create tables. They also need the
USAGE
privilege on the storage volume associated with that database or table. Why this is required In the shared-data (compute-storage separation) architecture, every table must be mapped to a Storage Volume (which points to S3, HDFS, etc.). * When a user creates a table, the table inherits the
storage_volume
property from the database. * To "use" this storage volume for data persistence, StarRocks requires the user to have the
USAGE
privilege on that specific volume. Without it, the table creation will fail because the user is not authorized to interact with the underlying remote storage resource. How to fix it You need to grant the
USAGE
privilege on the storage volume to the user or the role assigned to them:
Copy code
sql
-- Grant USAGE on a specific storage volume
GRANT USAGE ON STORAGE VOLUME <storage_volume_name> TO USER <username>;

-- Or if you are using roles
GRANT USAGE ON STORAGE VOLUME <storage_volume_name> TO ROLE <role_name>;
Verification You can check which storage volume your database is using by running:
Copy code
sql
SHOW CREATE DATABASE <database_name>;
Look for the
"storage_volume" = "..."
property in the output. That is the volume you need to grant
USAGE
on. Summary of required privileges for
CREATE TABLE
in shared-data:
1.
CREATE TABLE
on the Database (included in your
ALL
grant). 2.
USAGE
on the Storage Volume. References • sql-reference/sql-statements/cluster-management/storage_volume/CREATE_STORAGE_VOLUME.md • deployment/shared_data/feature-support-shared-data.md • quick_start/shared-data.md • deployment/shared_data/azure.md • deployment/shared_data/hdfs.md • faq/shared_data_faq.md