AWS RedshiftDatabase

Setup Database and Create a Read-Only user in AWS Redshift and Mysql

In this Blog, we explained how to Setup Database and Create a Read-Only user in AWS Redshift and Mysql. Even if you’re the only user of your data warehouse, it is not advised to use the root or admin password.  As a rule and as a precaution you should create additional credentials and a profile for any user that will have access to your DW.  Some systems provide an easier way of doing it than others.

In the case of Amazon’s Redshift, it is not very straightforward.  Because sometimes, flexibility comes with complexity. And that’s what we encountered when we tried to create a user with read-only access to a specific schema.  Here’s what you will need to achieve this task:Setup Database and Create a Read-Only user in AWS Redshift and Mysql

  • Setup Database in Redshift 

create database [db-name];
revoke all on schema public from public;
create schema [schema-name];
create table [schema-name].[table-name](
  …
)Setup Database and Create a Read-Only user in AWS Redshift and Mysql
  • Create Read-only User in Redshift 

create user [user-name] password ‘[password]’;
grant usage on schema [schema-name] to [user-name];
alter user [user-name] set search_path to [schema-name];
grant select on table [schema-name].[table-name] to [user-name];
  • Create read-only user on MySQL

You have learned how to Setup Database and Create a Read-Only user in AWS Redshift and Mysql.
Show More

Related Articles

4 Comments

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Close