can not load certificate


I want to connect to the database with cmd.

I used this connection string but I got this 2 errors:

  1. Can not load ceritifacte are you sure it is in correct folder
  2. The Command “sslrootcert” is either misspelled

What I am do wrong ?

cockroach sql --url=postgres://username:password@cloud-host:26257/cluster-data.defaultdb?sslmode=verify-full&sslrootcert=C:\Users\thomas\Desktop\

To fix error #1, I would make sure that the certificate file is at the same path that you specified in the “url” argument.

To fix error #2, can you try quoting or escaping the URL string? I think it’s interpreting the & as a special character so it thinks that sslrootcert=C:\Users\thomas\Desktop\ is its own command. Try:

cockroach sql "--url=postgres://username:password@cloud-host:26257/cluster-data.defaultdb?sslmode=verify-full&sslrootcert=C:\Users\thomas\Desktop\"