Skip to content

Instantly share code, notes, and snippets.

@ryanthames
Last active June 4, 2020 14:17
Show Gist options
  • Save ryanthames/234562b4711ddeea4db3557df7023b0d to your computer and use it in GitHub Desktop.
Save ryanthames/234562b4711ddeea4db3557df7023b0d to your computer and use it in GitHub Desktop.
Run cockroach in single node "cluster"
# Starts a single node instance of cockroach on localhost
cockroach start-single-node --insecure --listen-addr=localhost --http-addr=localhost:PORT_NUM
# example of how to connect sql prompt to "cluster"
cockroach sql --insecure --database=database_name
# Create a database, user, grant permissions
create database if not exists database_name;
create user if not exists admin_user;
create user if not exists normal_user;
grant all on database database_name to admin_user;
grant select, insert, update on database database_name to normal_user;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment