Skip to main content
Version: V1.1.0

SeekdbAdminClient

SeekdbAdminClient provides database management operations. It uses the same database connection mode as SeekdbClient, but only supports database management-related operations.

Connect to a remote server

You can use SeekdbAdminClient to connect to a remote server. This client supports connecting to seekdb or OceanBase Database.

tip

Before you connect to a remote server, make sure that you have deployed the server mode of seekdb or OceanBase Database.
For information about how to deploy the server mode of seekdb, see Deploy seekdb by using yum install.
For information about how to deploy OceanBase Database, see Overview.

Example: Connect to the server mode of seekdb

import { SeekdbAdminClient } from "seekdb";

// Remote server mode - database management (seekdb Server)
const admin = new SeekdbAdminClient({
host: "127.0.0.1",
port: 2881,
user: "root",
password: ""
});

Parameters:

ParameterValue typeRequiredDescriptionExample value
hoststringYesThe IP address of the server where the instance is located.127.0.0.1
portstringYesThe port of the instance. The default value is 2881.2881
userstringYesThe username. The default value is root.root
passwordstringYesThe password corresponding to the user. If you do not specify the password parameter or specify an empty string, the system retrieves the password from the SEEKDB_PASSWORD environment variable.

Example: Connect to OceanBase Database

import { SeekdbAdminClient } from "seekdb";

// Remote server mode - database management (OceanBase Server)
const admin = new SeekdbAdminClient({
host: "127.0.0.1",
port: 2881,
tenant: "sys", // The default tenant of OceanBase Database
user: "root",
password: ""
});

Parameters:

ParameterValue typeRequiredDescriptionExample value
hoststringYesThe IP address of the server where the database is located.127.0.0.1
portstringYesThe port of OceanBase Database. The default value is 2881.2881
tenantstringNoThe name of the tenant. This parameter is not required for seekdb, but it is required for OceanBase Database. The default value is sys.sys
userstringYesThe username corresponding to the tenant. The default value is root.root
passwordstringYesThe password corresponding to the user.

APIs supported when you use SeekdbAdminClient to connect to a database

When you use SeekdbAdminClient to connect to a database, you can call the following APIs.

APIDescriptionRelated document link
createDatabaseCreates a new database.Documentation
getDatabaseQueries a specified database.Documentation
deleteDatabaseDeletes a specified database.Documentation
listDatabasesLists all databases.Documentation