Sunday 12 January 2020

Cassandra: Drop or delete keyspace


You can use 'DROP KEYSPACE' command to drop a keyspace. Once you execute the 'DROP KEYSPACE' command, it removes everything (including tables, functions, data in the keyspace).

Syntax
DROP KEYSPACE [IF EXISTS] keyspace_name

What if you are trying to drop a keyspace, which is not existed anymore?
You will get an error like 'ConfigurationException: Cannot drop non existing keyspace 'cassandratutorial'.

cqlsh> DROP KEYSPACE cassandratutorial;
ConfigurationException: Cannot drop non existing keyspace 'cassandratutorial'.



Previous                                                    Next                                                    Home

No comments:

Post a Comment