Manage Database Connections

This topic describes how to connect to and disconnect from a Zilliz Cloud database.

Prerequisites

  • A Zilliz Cloud account.
  • An active project and a database within it.
  • User access to the project and database within.
  • Your IP address added in the IP White List.
  • PyMilvus or Java SDK installed on your local device.

Check the Zilliz Cloud database endpoint

Log in your Zilliz Cloud account. In the Databases tab, click Connect Service on the card that represents your Zilliz Cloud database to enter the Connect your service pop-up window.

Copy the endpoint information of your Zilliz Cloud database.

You can also copy the Quick Start code and integrate it directly in your own script. Switch to your programming language by clicking the corresponding tab on the top of the pop-up window.

Connect to a Zilliz Cloud database

Construct a Zilliz Cloud database connection.

# Run `python3` in your terminal to operate in the Python interactive mode.
from pymilvus import connections
connections.connect(
  alias="default", 
  uri='endpoint', 
  port='19530',
  secure=True,
  user='user',
  password='password'
)
final MilvusServiceClient milvusClient = new MilvusServiceClient(
  ConnectParam.newBuilder()
    .withHost("endpoint")
    .withPort(19530)
    .withSecure(true)
    .withAuthorization("user","password")
    .build()
);
Parameter Description
alias Alias of the Zilliz Cloud database connection to construct.
uri Endpoint of the Zilliz Cloud database.
port Port of the Zilliz Cloud database.
secure Boolean value to control the secure mode. It must be set as True.
user Username of the user to log in the Zilliz Cloud database.
password Password of the user to log in the Zilliz Cloud database.
Parameter Description
Host Endpoint of the Zilliz Cloud database.
Port Port of the Zilliz Cloud database.
Secure Boolean value to control the secure mode. It must be set as true.
Authorization Username and password of the user to log in the Zilliz Cloud database.

Disconnect from a Zilliz Cloud database

Disconnect from a Zilliz Cloud database.

connections.disconnect("default")
milvusClient.close()
Parameter Description
alias Alias of the Zilliz Cloud database to disconnect from.

Troubleshooting

Q: Why can't I connect to the database after the database is created?

A: You can identify the problem by following these steps:

  1. Check if the database status is AVAILABLE. You cannot connect to the database if the database is initializing, deleted, or its IP whitelist is being updated.
  2. Check if the IP address of your connection is included in the IP white list.
  3. Test the connectivity of the port by running telnet in01-<xxx>.<region>.vectordb.zillizcloud.com 19530.

See Troubleshooting guide for detailed instruction. If the issue remains unsolved after all above steps are tried, please contact our support team at cloud-support@zilliz.com.