The REGISTER STORAGE UNIT
syntax is used to register storage unit for the currently selected logical database.
RegisterStorageUnit ::=
'REGISTER' 'STORAGE' 'UNIT' storageUnitDefinition (',' storageUnitDefinition)*
storageUnitDefinition ::=
StorageUnitName '(' ( 'HOST' '=' hostName ',' 'PORT' '=' port ',' 'DB' '=' dbName | 'URL' '=' url ) ',' 'USER' '=' user (',' 'PASSWORD' '=' password )? (',' proerties)?')'
storageUnitName ::=
identifier
hostname ::=
string
port ::=
int
dbName ::=
string
url ::=
string
user ::=
string
password ::=
string
proerties ::=
PROPERTIES '(' property ( ',' property )* ')'
property ::=
key '=' value
key ::=
string
value ::=
string
use
command to
successfully select a database;storageUnitName
is case-sensitive;storageUnitName
needs to be unique within the current database;storageUnitName
name only allows letters, numbers and _
, and must start with a letter;poolProperty
is used to customize connection pool parameters, key
must be the same as the connection pool
parameter name, value
supports int and String types;password
contains special characters, it is recommended to use the string form; For example, the string form
of password@123
is "password@123"
.REGISTER STORAGE UNIT su_1 (
HOST="127.0.0.1",
PORT=3306,
DB="db_1",
USER="root",
PASSWORD="root"
);
REGISTER STORAGE UNIT su_1 (
HOST="127.0.0.1",
PORT=3306,
DB="db_1",
USER="root",
PASSWORD="root",
PROPERTIES("maximumPoolSize"=10)
);
REGISTER STORAGE UNIT su_2 (
URL="jdbc:mysql://127.0.0.1:3306/db_2?serverTimezone=UTC&useSSL=false",
USER="root",
PASSWORD="root",
PROPERTIES("maximumPoolSize"=10,"idleTimeout"="30000")
);
REGISTER
, STORAGE
, UNIT
, HOST
, PORT
, DB
, USER
, PASSWORD
, PROPERTIES
, URL