Skip to content

Instantly share code, notes, and snippets.

@mhausenblas
Created May 24, 2016 09:29
Show Gist options
  • Save mhausenblas/7086bc6080a84cbbaf10f06d4d4722ab to your computer and use it in GitHub Desktop.
Save mhausenblas/7086bc6080a84cbbaf10f06d4d4722ab to your computer and use it in GitHub Desktop.
CockroachDB: set up database and user using the internal SQL client
core@ip-10-0-7-99 ~ $ docker run -it cockroachdb/cockroach:beta-20160512 sql --host=10.0.7.99 --port=12504
# Welcome to the cockroach SQL interface.
# All statements must be terminated by a semicolon.
# To exit: CTRL + D.
root@10.0.7.99:12504> CREATE DATABASE bank;
CREATE DATABASE
root@10.0.7.99:12504> show databases;
+----------+
| Database |
+----------+
| bank |
| system |
+----------+
root@10.0.7.99:12504> GRANT ALL ON DATABASE bank TO maxroach;
GRANT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment