Last active
June 4, 2020 14:17
-
-
Save ryanthames/234562b4711ddeea4db3557df7023b0d to your computer and use it in GitHub Desktop.
Run cockroach in single node "cluster"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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