TablePlus is a cross-platform database management tool designed to simplify database connection, querying, editing, and management processes. It supports managing MySQL, PostgreSQL, SQLite, SQL Server, Oracle, and other databases. This article explains how to connect to and use the MySQL and ClickHouse databases created in ByteHouse within TablePlus.
ByteHouse supports connections via IAM users or database users. Configure your user account information before using this tool. For the difference between IAM users and database users, please refer toOverview.
After logging into the ByteHouse console, go to the Tenant Management section and then the Basic Information page. Check the network group configuration to confirm that the VPC is bound and that a public domain is linked.
go to the Tenant Management > Parameter Settings page at the top, check the set default compute group, and ensure this compute group is running and not stopped. all subsequent operations, such as data queries after connecting to ByteHouse, will use the default compute group configured here.
IAM users use an API Key as the connection password. You can create a new API key in the API Key module on the Tenant Management > Connection Information page at the top and save the API key locally for later configuration.
tip
A sub-account supports creating up to two API Keys. If you have previously created API Keys, you can also use the existing API Keys directly.
the database user's account consists of the ByteHouse account, database username, account, and optionally the environment ID, formatted as {accountID_or_accountName}::{username}[::{envID}]. the password is the database user's password.
After logging in and entering the ByteHouse console, click the profile icon in the top right to view and copy your account ID or name.
After logging in and entering the ByteHouse console, go to the Permission Management section at the top, then to the User page. View the user list, filter users by Database type, then view and copy the database username. If no database user has been created, contact the administrator for Manage Database Accountscreation guidance.
The database user password is set by the administrator. Contact the administrator to obtain the password. If the password is lost or forgotten, contact the administrator to reset it. For details, please refer to Reset Passwordthe documentation.
If using the default environment, no configuration is needed. To use another environment, specify the environment name. You can log in and enter the ByteHouse console, then go to the Tenant Management section at the top, and open the Basic Information page to view the current environment name.
You can create MySQL or ClickHouse data sources using TablePlus and connect them to ByteHouse.
Launch TablePlus, right-click in the blank area on the right side of the interface, then click New > Connection.
Search for and select MySQL in the popup window, then click Create.
In the MySQL Connection popup, fill in the configuration information according to the connection details obtained from ByteHouse 侧配置here:
Parameter | Connect using IAM user | Connect using database user |
|---|---|---|
Name | Custom connection name. | |
Host/IP | Set as ByteHouse network domain name in the format: | |
Port | Database port number, set to the fixed value: 3306. | |
User & Password | You can obtain the API Key in the ByteHouse Console>Tenant Management>Connection Information. See Obtain API keyfor details.
|
|
Database | Enter your database name or leave blank. | |
SSL | Select REQUIRED. | |
Click Test to check if the connection is successful. When the input box background turns green, it indicates a successful connection.
The example of a successful connection is shown below:
After successfully testing the connection, click Connect to create the connection.
(Optional) Configure the compute group information. Click Bootsrap commands to add the set virtual_warehouse='virtual_warehouse_id' bootstrap command.'virtual_warehouse_id' should be set to the ByteHouse compute group ID you use. You can find the required compute group ID by logging into the ByteHouse console and clicking the compute groups tab at the top.
Before using the SQL editor each time, run set virtual_warehouse='virtual_warehouse_id'.
Launch TablePlus, right-click on the blank area on the right side of the interface, then click New > Connection.
Search for and select ClickHouse in the pop-up window, then click Create.
In the ClickHouse Connection pop-up, fill in the configuration according to the connection information obtained from ByteHouse 侧配置here:
Parameters | Connect using IAM user | Connect using database user |
|---|---|---|
Name | Custom connection name. | |
Host | Set as the ByteHouse network domain name in this format: | |
Port | The database port, set to the fixed value: 19000. | |
User & Password | The username and password for logging into the ByteHouse database.
|
|
Database | Enter your database name or leave empty. | |
SSL | Select | |
Click Test to verify the connection. When the input box background turns green, the connection is successful.
An example of a successful connection is shown below:
After the connection test succeeds, click Connect to create the connection.
(Optional) Configure compute group information. Click Bootstrap commands to add the bootstrap command set virtual_warehouse='virtual_warehouse_id'.'virtual_warehouse_id' is set to the ByteHouse compute group ID you use. You can find the required compute group ID by logging into the ByteHouse console and clicking the compute group tab at the top.
Before each use of the SQL editor, run set virtual_warehouse='virtual_warehouse_id'.