-4
如何在Cassandra中使用Python创建密钥空间?Python Cassandra不会创建密钥空间
from cassandra.cluster import Cluster
cluster = Cluster(['cassandra.sucks.com'])
session = cluster.connect()
session.execute('CREATE KEYSPACE IF NOT EXISTS kong')
File "cassandra/cluster.py", line 1998, in cassandra.cluster.Session.execute (cassandra/cluster.c:34869)
File "cassandra/cluster.py", line 3781, in cassandra.cluster.ResponseFuture.result (cassandra/cluster.c:73073)
cassandra.protocol.SyntaxException: <Error from server: code=2000 [Syntax error in CQL query] message="line 0:-1 mismatched input '<EOF>' expecting K_WITH">
我建议尝试的东西'cqlsh'并使用自动完成第一找出语法,如果你不打算尝试读取任何文件。 –