如何使用CQL在Cassandra中切换Keyspace?

Pan*_*kaj 5 database cql cassandra cql3 cassandra-2.0

我曾经USE billKeyspace;进入密钥空间并开始使用它.现在我想退出这个键空间并输入另一个键空间.怎么做?

如果我使用exit;quit;它退出cql会话本身,然后我必须再次连接.

Pan*_*kaj 8

要切换键空间,我没有找到任何其他方法,但使用USE otherKeySpace;.


小智 7

您只需使用"use"命令即可切换.

cqlsh>    DESC KEYSPACEs;

system_distributed system_auth system system_traces

cqlsh> use system_distributed;
cqlsh:system_distributed>
cqlsh:system_distributed>
cqlsh:system_distributed> use system_auth;
cqlsh:system_auth>
Run Code Online (Sandbox Code Playgroud)