0

powershell 経由で cockroachdb に接続できないのはなぜですか?

私はこのコマンドを使用します:

cockroach sql --url postgres://username@cloud-host:26257/defaultdb?sslmode=require&options=--cluster=clustername;

次のエラーが表示されます: 無効なクラスター名 08004

しかし、クラスター名は正しいものです。

€:

Node.js

//For secure connection:
// const fs = require('fs');
const { Pool } = require("pg");

// Configure the database connection.

const config = {
  user: "xxxxx",
  password: "xxxx",
  cluster_name: "xxxx",
  host: "xxxx",
  database: "wxxx",
  port: 26257,
  ssl: {
    rejectUnauthorized: false,
  },
  //For secure connection:
  /*ssl: {
        ca: fs.readFileSync('/certs/ca.crt')
            .toString()
    }*/
};

// Create a connection pool

const pool = new Pool(config);

router.get('/', async (req, res) => {
  const client = await pool.connect();
  const d = await client.query('CREATE TABLE test (id INT, name VARCHAR, desc VARCHAR);');
  console.log(d);
  return res.json({
    message: 'BOSY'
  })

このエラーを取得します。

CodeParamsRoutingFailed: rejected by BackendConfigFromParams: Invalid cluster name
4

2 に答える 2