Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/doc/01-guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ These tutorials are intended to help you get started with Databend:
* [How to Connect Databend with MySQL Client](../11-integrations/00-api/01-mysql-handler.md)
* [How to Connect Databend with ClickHouse HTTP Handler](../11-integrations/00-api/02-clickhouse-handler.md)
* [How to Connect Databend with REST API](../11-integrations/00-api/00-rest.md)
* [How to Connect Databend with DBeaver SQL IDE](../11-integrations/20-gui-tool/01-dbeaver.md)
* [How to Connect Databend with MySQL-Compatible Clients](../11-integrations/30-access-tool/00-mysql.md)
* [How to Connect Databend with bendsql](../11-integrations/30-access-tool/01-bendsql.md)
* [How to Execute Queries in Python](../03-develop/01-python.md)
* [How to Query Databend in Jupyter Notebooks](../11-integrations/20-gui-tool/00-jupyter.md)
* [How to Execute Queries in Golang](../03-develop/00-golang.md)
Expand Down
65 changes: 0 additions & 65 deletions docs/doc/11-integrations/20-gui-tool/01-dbeaver.md

This file was deleted.

66 changes: 66 additions & 0 deletions docs/doc/11-integrations/30-access-tool/00-mysql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: MySQL-Compatible Clients
sidebar_label: MySQL-Compatible Clients
description:
Connect Databend from MySQL-compatible clients.
---

Databend provides support for MySQL compatible CLI and GUI clients where you can connect to Databend and execute queries from.

:::note
Databend is not a complete implementation of the MySQL protocol, so certain programs such as some ORM frameworks may not be able to connect to Databend.
:::

To connect to Databend with MySQL compatible clients, you will need to connect to port 3307 with a SQL user created in Databend.

This example connects to a remote Databend with a SQL user named `databend`:

```shell
mysql -h172.20.0.2 -udatabend -P3307 -pdatabend
```

This example connects to a local Databend with the user `root`:

```shell
mysql -h127.0.0.1 -uroot -P3307
```

## Built-in Accounts

There are four built-in accounts in Databend that can be accessed from a local machine without requiring a password. These accounts are immutable and possess the highest level of privileges, meaning their settings cannot be altered or removed. Additionally, it is not possible to change or update their passwords.

- `root@127.0.0.1`
- `root@localhost`
- `default@127.0.0.1`
- `default@localhost`

## Example: Connect from DBeaver

DBeaver is a universal database management tool for everyone who needs to work with data in a professional way. With DBeaver you are able to manipulate with your data like in a regular spreadsheet, create analytical reports based on records from different data storages, export information in an appropriate format.

The following steps show how to establish a connection to Databend with DBeaver.

1. Create a SQL user in Databend.

```sql
CREATE USER user1 IDENTIFIED BY 'abc123';
GRANT ALL ON *.* TO user1;
```

2. In DBeaver, choose a driver for the new connection. Select `MySQL`, then click **Next**.

<p align="center">
<img src="https://datafuse-1253727613.cos.ap-hongkong.myqcloud.com/integration/ingegration-dbeaver-connection-1.png" width="500"/>
</p>

3. On the **Connection Settings** screen, configure your connection settings, including:
* Host
* Port
* Database name
* Username and password

<p align="center">
<img src="https://datafuse-1253727613.cos.ap-hongkong.myqcloud.com/integration/ingegration-dbeaver-connection-2.png" width="500"/>
</p>

4. Click **Test Connection...** to see if the connection works.
65 changes: 65 additions & 0 deletions docs/doc/11-integrations/30-access-tool/01-bendsql.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: bendsql
sidebar_label: bendsql
description:
Databend-native CLI
---

[bendsql](https://github.com/databendcloud/bendsql) is a command line tool that has been designed specifically for Databend. It allows users to establish a connection with Databend and execute queries directly from a CLI window.

This tool is particularly useful for those who prefer a command line interface and need to work with Databend on a regular basis. With bendsql, users can easily and efficiently manage their databases, tables, and data, and perform a wide range of queries and operations with ease.

## Downloading and Installing bendsql

To download and install bendsql, please go to the [bendsql](https://github.com/databendcloud/bendsql) repository on GitHub and follow the README instructions.

## Connecting to Databend

Use `bendsql connect` to connect to a Databend instance:

```shell
eric@ericdeMacBook rsdoc % bendsql connect -h
Connect to Databend Instance

USAGE
bendsql connect [flags]

FLAGS
-d, --database string (default "default")
-H, --host string (default "localhost")
-p, --password string
-P, --port int (default 8000)
--ssl
-u, --user string (default "root")

INHERITED FLAGS
--help Show help for command

LEARN MORE
Use 'bendsql <command> <subcommand> --help' for more information about a command.
```

To connect to a local Databend, simply run `bendsql connect`:

```shell
eric@ericdeMacBook rsdoc % bendsql connect
Connected to Databend on Host: localhost
Version: DatabendQuery v0.9.58-nightly-790be61(rust-1.68.0-nightly-2023-03-01T16:41:18.376657Z)
```
## Running Queries with bendsql

After connecting bendsql to your Databend instance, you can use `bendsql query` to run queries with the tool:

```shell
eric@ericdeMacBook rsdoc % bendsql query
Connected with driver databend (DatabendQuery v0.9.58-nightly-790be61(rust-1.68.0-nightly-2023-03-01T16:41:18.376657Z))
Type "help" for help.

dd:root@localhost/default=> SELECT NOW();
+------------------------+
| now() |
+------------------------+
| 2023-03-02T21:47:10.4Z |
+------------------------+
(1 row)
```
7 changes: 7 additions & 0 deletions docs/doc/11-integrations/30-access-tool/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"label": "Clients",
"link": {
"type": "generated-index",
"slug": "/integrations/clients"
}
}