After you create an OceanBase Database tenant, you can verify the connectivity between the OBProxy service and OceanBase Database by using the following method:
Use the MySQL Command Line Client or OBClient to log on to the endpoint (IP address:port format) of OBProxy. Ensure that you can connect to OceanBase Database and run the test statements.
Example:
mysql -h[IP address of OBProxy] -P2883 -uroot@[Tenant name]#[Cluster name] -Dtest -p'test' -c -Ne "SELECT 'ok'"
Warning: Using a password on the command line interface can be insecure.
+----+
| ok |
+----+
Note
Connection parameters and descriptions:
- -h: specifies the IP address to connect to OceanBase Database, which is usually an OBProxy domain name.
- -u: specifies the connection account of the tenant. Supported formats:
User name@Tenant name#Cluster nameandCluster name:Tenant name:User name. The default username of the administrator of the MySQL tenant is root.- -P: specifies the OceanBase Database connection port, which is also the listening port of OBProxy.
- -p: specifies the account password. For security reasons, you do not need to specify this parameter. In that case, you will be prompted to enter a password later. The password is invisible.
- -c: specifies that comments must not be ignored in the runtime environment of MySQL.
- -Ne: specifies to execute an SQL statement when connecting to OceanBase Database in MySQL mode.
OK in the response indicates that the test is successful, and the client has connected to the OBServer node through the OBProxy.