Linux, DevOps and Cloud Expert at Linux Guru !





Here are the steps to create cockroach db database and uses of cockroach db database.


Create CockroachDB database : 
CREATE DATABASE cockroachdb;


Create CockroachDB Database User : 
CREATE USER cockroachdb WITH PASSWORD 'vishal';   


Grant Privileges on CockroachDB Databases : 
GRANT ALL ON DATABASE cockroachdb TO cockroachuser;
GRANT ALL ON TABLE cockroachdb.* TO cockroachuser;


Change cockroach db user password : 

ALTER USER vishal WITH PASSWORD 'newpassword';


Login to kubernetes deploy cockroach : 
psql 'postgresql://username@ip:26257?sslmode=allow'


Import Cockroach db Dump : 
psql -p 26257 -h host -d database -U vishal < database.sql


How to rename Cockroach database : 
ALTER DATABASE olddbname RENAME TO newdbname;



Privilege 
Levels
ALL Database, Table
CREATE Database, Table
DROP Database, Table
GRANT Database, Table
SELECT Table
INSERT Table
DELETE Table
UPDATE Table

No comments:

Post a Comment