Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已将应用程序的数据模型存储在一个.sql文件中,并希望针对我的 Cockroach 部署运行它。如何执行 SQL 文件?
.sql
执行 .sql 文件的最简单方法是使用cockroach sql --database=[your database] < [import file].sql.
cockroach sql --database=[your database] < [import file].sql
这只需要针对集群的一个节点(或您的负载均衡器)运行,因为架构和所有数据都会在整个集群中自动复制和重新平衡。