Skip to content

Commit 16979b9

Browse files
authored
Merge pull request #10595 from soyeric128/mysql-clients
docs: mysql clients
2 parents bc53de6 + 0c78475 commit 16979b9

File tree

5 files changed

+140
-66
lines changed

5 files changed

+140
-66
lines changed

docs/doc/01-guides/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ These tutorials are intended to help you get started with Databend:
1818
* [How to Connect Databend with MySQL Client](../11-integrations/00-api/01-mysql-handler.md)
1919
* [How to Connect Databend with ClickHouse HTTP Handler](../11-integrations/00-api/02-clickhouse-handler.md)
2020
* [How to Connect Databend with REST API](../11-integrations/00-api/00-rest.md)
21-
* [How to Connect Databend with DBeaver SQL IDE](../11-integrations/20-gui-tool/01-dbeaver.md)
21+
* [How to Connect Databend with MySQL-Compatible Clients](../11-integrations/30-access-tool/00-mysql.md)
22+
* [How to Connect Databend with bendsql](../11-integrations/30-access-tool/01-bendsql.md)
2223
* [How to Execute Queries in Python](../03-develop/01-python.md)
2324
* [How to Query Databend in Jupyter Notebooks](../11-integrations/20-gui-tool/00-jupyter.md)
2425
* [How to Execute Queries in Golang](../03-develop/00-golang.md)

docs/doc/11-integrations/20-gui-tool/01-dbeaver.md

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: MySQL-Compatible Clients
3+
sidebar_label: MySQL-Compatible Clients
4+
description:
5+
Connect Databend from MySQL-compatible clients.
6+
---
7+
8+
Databend provides support for MySQL compatible CLI and GUI clients where you can connect to Databend and execute queries from.
9+
10+
:::note
11+
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.
12+
:::
13+
14+
To connect to Databend with MySQL compatible clients, you will need to connect to port 3307 with a SQL user created in Databend.
15+
16+
This example connects to a remote Databend with a SQL user named `databend`:
17+
18+
```shell
19+
mysql -h172.20.0.2 -udatabend -P3307 -pdatabend
20+
```
21+
22+
This example connects to a local Databend with the user `root`:
23+
24+
```shell
25+
mysql -h127.0.0.1 -uroot -P3307
26+
```
27+
28+
## Built-in Accounts
29+
30+
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.
31+
32+
33+
- `root@localhost`
34+
35+
- `default@localhost`
36+
37+
## Example: Connect from DBeaver
38+
39+
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.
40+
41+
The following steps show how to establish a connection to Databend with DBeaver.
42+
43+
1. Create a SQL user in Databend.
44+
45+
```sql
46+
CREATE USER user1 IDENTIFIED BY 'abc123';
47+
GRANT ALL ON *.* TO user1;
48+
```
49+
50+
2. In DBeaver, choose a driver for the new connection. Select `MySQL`, then click **Next**.
51+
52+
<p align="center">
53+
<img src="https://datafuse-1253727613.cos.ap-hongkong.myqcloud.com/integration/ingegration-dbeaver-connection-1.png" width="500"/>
54+
</p>
55+
56+
3. On the **Connection Settings** screen, configure your connection settings, including:
57+
* Host
58+
* Port
59+
* Database name
60+
* Username and password
61+
62+
<p align="center">
63+
<img src="https://datafuse-1253727613.cos.ap-hongkong.myqcloud.com/integration/ingegration-dbeaver-connection-2.png" width="500"/>
64+
</p>
65+
66+
4. Click **Test Connection...** to see if the connection works.
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: bendsql
3+
sidebar_label: bendsql
4+
description:
5+
Databend-native CLI
6+
---
7+
8+
[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.
9+
10+
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.
11+
12+
## Downloading and Installing bendsql
13+
14+
To download and install bendsql, please go to the [bendsql](https://github.com/databendcloud/bendsql) repository on GitHub and follow the README instructions.
15+
16+
## Connecting to Databend
17+
18+
Use `bendsql connect` to connect to a Databend instance:
19+
20+
```shell
21+
eric@ericdeMacBook rsdoc % bendsql connect -h
22+
Connect to Databend Instance
23+
24+
USAGE
25+
bendsql connect [flags]
26+
27+
FLAGS
28+
-d, --database string (default "default")
29+
-H, --host string (default "localhost")
30+
-p, --password string
31+
-P, --port int (default 8000)
32+
--ssl
33+
-u, --user string (default "root")
34+
35+
INHERITED FLAGS
36+
--help Show help for command
37+
38+
LEARN MORE
39+
Use 'bendsql <command> <subcommand> --help' for more information about a command.
40+
```
41+
42+
To connect to a local Databend, simply run `bendsql connect`:
43+
44+
```shell
45+
eric@ericdeMacBook rsdoc % bendsql connect
46+
Connected to Databend on Host: localhost
47+
Version: DatabendQuery v0.9.58-nightly-790be61(rust-1.68.0-nightly-2023-03-01T16:41:18.376657Z)
48+
```
49+
## Running Queries with bendsql
50+
51+
After connecting bendsql to your Databend instance, you can use `bendsql query` to run queries with the tool:
52+
53+
```shell
54+
eric@ericdeMacBook rsdoc % bendsql query
55+
Connected with driver databend (DatabendQuery v0.9.58-nightly-790be61(rust-1.68.0-nightly-2023-03-01T16:41:18.376657Z))
56+
Type "help" for help.
57+
58+
dd:root@localhost/default=> SELECT NOW();
59+
+------------------------+
60+
| now() |
61+
+------------------------+
62+
| 2023-03-02T21:47:10.4Z |
63+
+------------------------+
64+
(1 row)
65+
```
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"label": "Clients",
3+
"link": {
4+
"type": "generated-index",
5+
"slug": "/integrations/clients"
6+
}
7+
}

0 commit comments

Comments
 (0)