Cassandra CQLsh代表Cassandra CQL shell。 CQLsh指定如何使用Cassandra命令。 安裝後,Cassandra提供了一個提示Cassandra查詢語言shell(cqlsh)。 它有助於用戶與之通信。
Cassandra命令在CQLsh上執行。 看起來像這樣:
啟動CQLsh:
D:\software\apache-cassandra-3.10\bin>cqlsh
WARNING: console codepage must be set to cp65001 to support utf-8 encoding on Windows platforms.
If you experience encoding problems, change your console codepage with 'chcp 65001' before starting cqlsh.
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.10 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
WARNING: pyreadline dependency missing. Install to enable tab completion.
cqlsh>
CQLsh提供了很多選項,在下表中是一些常用的命令:
選項 | 使用/作用 |
---|---|
help | 此命令用於顯示有關CQLsh命令選項的幫助主題。 |
version | 它用於查看您正在使用的CQLsh的版本。 |
color | 它用於彩色輸出。 |
debug | 它顯示其他調試資訊。 |
execute | 它用於引導shell接受並執行CQL命令。 |
file= “file name” | 通過使用此選項,cassandra將在給定檔中執行命令並退出。 |
no-color | 它指示Cassandra不使用彩色輸出。 |
u “username” | 使用此選項可以驗證用戶。 默認用戶名為:cassandra 。 |
p “password” | 使用此選項,您可以使用密碼驗證用戶。 默認密碼是:cassandra 。 |
上一篇:
Cassandra安裝與配置
下一篇:
Cassandra創建鍵空間(Keyspace)