Navicat is a general-purpose database client tool. It uses JDBC drivers provided by databases to connect to the databases. Navicat supports not only common relational databases but also NoSQL databases and distributed databases.
You can use either the built-in OceanBase driver or MySQL driver to connect to a MySQL tenant of OceanBase Database. This topic uses the OceanBase driver as an example to describe how to connect to a MySQL tenant of OceanBase Database by using Navicat.
Prerequisites
You have obtained and installed Navicat. For more information, visit Navicat Premium Download.
The IP address of the OBServer node to connect to is networked with the device where Navicat is installed.
You have installed OceanBase Database and created a MySQL tenant.
Procedure
Step 1: Obtain the database connection string
Obtain the database connection string from the deployment personnel or administrator of OceanBase Database. For example:
obclient -h$host -P$port -u$user_name -p$password -D$database_name
Parameter description:
$host: the IP address for connecting to OceanBase Database. For connection through OceanBase Database Proxy (ODP), use the IP address of an ODP. For direct connection, use the IP address of an OBServer node.$port: the port for connecting to OceanBase Database. For connection through ODP, the default value is2883, which can be customized when ODP is deployed. For direct connection, the default value is2881, which can be customized when OceanBase Database is deployed.$database_name: the name of the database to be accessed.Notice
The user used to connect to the tenant must have the
CREATE,INSERT,DROP, andSELECTprivileges on the database. For more information about user privileges, see Privilege types in MySQL mode.$user_name: the tenant connection account. For connection through ODP, the format isusername@tenant name#cluster nameorcluster name:tenant name:username. For direct connection, the format isusername@tenant name.$password: the account password.
For more information about connection strings, see Connect to an OceanBase tenant by using OBClient.
Here is an example:
obclient -hxxx.xxx.xxx.xxx -P2881 -utest_user001@mysql001 -p****** -Dtest
Step 2: Connect to OceanBase Database using Navicat
Note
The interface may vary slightly depending on the version of Navicat you are using. This topic uses Navicat 16.3.7 as the example to describe how to connect to the database. For other versions, refer to the documentation of the corresponding version.
Click Connect > OceanBase > OceanBase Enterprise Edition (MySQL mode), and then click Create Connection.
On the Create Connection page, enter the connection information of the database you want to connect to, and then click Test Connection.
Note
You can connect to the database by IP direct connection or OBProxy proxy. When you use IP direct connection, enter the `mysql_port` for the port. The default port is 2881. When you use OBProxy for connection, enter the `proxy_port` for the port. The default port is 2883.
If Test Connection is displayed in the Connected state, you can click Save to connect to OceanBase Database.
Double-click the name of the database displayed in the Database Browser pane. The database is displayed as shown in the following figure, indicating that you are connected to OceanBase Database.
More information
For more information about how to connect to OceanBase Database by using Navicat, see official documentation of Navicat.
