【问题标题】:How to switch Keyspace in Cassandra using CQL?如何使用 CQL 在 Cassandra 中切换键空间?
【发布时间】:2017-05-19 00:54:58
【问题描述】:

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

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

【问题讨论】:

  • use otherKeyspace; ?
  • 你是对的,这确实有效。当我早些时候尝试时,我没有使用区分大小写的键空间名称,所以它失败了。

标签: database cassandra cql cassandra-2.0 cql3


【解决方案1】:

要切换键空间,我没有找到其他方法,只能使用USE otherKeySpace;

【讨论】:

    【解决方案2】:

    你可以不使用USE 命令,像这样:

     select * from KeySpace1.tbl ;
     select * from KeySpace2.tbl ;
    

    【讨论】:

      【解决方案3】:

      你可以通过“使用”命令简单地切换。

      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>
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-02-24
        • 2014-03-27
        • 2013-09-13
        • 1970-01-01
        • 2015-08-22
        • 2013-08-27
        • 2013-07-16
        相关资源
        最近更新 更多