Skip to content

Commit 819b7f5

Browse files
committed
Merge branch 'main' of https://github.com/ClickHouse/clickhouse-docs into add-lakekeeper-catalog
2 parents 25853d9 + b59ad0b commit 819b7f5

File tree

1,437 files changed

+15820
-8621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,437 files changed

+15820
-8621
lines changed

.github/workflows/check-build.yml

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
runs-on: ubuntu-latest
1717
strategy:
1818
matrix:
19-
check_type: [spellcheck, kbcheck, md-lint]
19+
check_type: [spellcheck, kbcheck, md-lint, glossary-check]
2020
steps:
2121
# Add setup steps per check here
2222
- uses: actions/checkout@v4
2323
- name: Install Aspell
2424
if: matrix.check_type == 'spellcheck'
2525
run: sudo apt-get update && sudo apt-get install -y aspell aspell-en
2626
- name: Set up Python
27-
if: matrix.check_type == 'kbcheck'
27+
if: matrix.check_type == 'kbcheck' || matrix.check_type == 'glossary-check'
2828
run: |
2929
curl -Ls https://astral.sh/uv/install.sh | sh
3030
uv clean
@@ -39,31 +39,25 @@ jobs:
3939
run: yarn add -D markdownlint-cli2
4040

4141
# Run the checks here
42-
- name: Run checks
43-
id: check_step
44-
run: |
45-
if [[ "${{ matrix.check_type }}" == "spellcheck" ]]; then
46-
yarn check-spelling
47-
exit_code=$?
48-
elif [[ "${{ matrix.check_type }}" == "kbcheck" ]]; then
49-
yarn check-kb
50-
exit_code=$?
51-
elif [[ "${{ matrix.check_type }}" == "md-lint" ]]; then
52-
yarn check-markdown
53-
exit_code=$?
54-
fi
55-
56-
if [[ $exit_code -ne 0 ]]; then
57-
echo "::error::${{ matrix.check_type }} check failed. See logs for details."
58-
exit 1
59-
fi
42+
- name: Run spellcheck
43+
if: matrix.check_type == 'spellcheck'
44+
run: yarn check-spelling
6045

61-
- name: Set check status
62-
if: steps.check_step.outcome != 'success'
63-
uses: actions/github-script@v6
64-
with:
65-
script: |
66-
core.setFailed('${{ matrix.check_type }} check failed.');
46+
- name: Run KB check
47+
if: matrix.check_type == 'kbcheck'
48+
run: yarn check-kb
49+
50+
- name: Run markdown lint
51+
if: matrix.check_type == 'md-lint'
52+
run: yarn check-markdown
53+
54+
- name: Run glossary check
55+
if: matrix.check_type == 'glossary-check'
56+
run: |
57+
echo "Extracting glossary from markdown..."
58+
python3 scripts/glossary/extract-glossary-terms.py
59+
echo "Checking glossary coverage..."
60+
python3 scripts/glossary/wrap-glossary-terms.py --check || echo "::warning::Glossary check found unwrapped terms (non-blocking)"
6761
6862
check_overall_status:
6963
needs: stylecheck
@@ -74,5 +68,4 @@ jobs:
7468
if: needs.stylecheck.result != 'success'
7569
run: |
7670
echo "::error::One or more checks of the style check failed."
77-
exit 1
78-
71+
exit 1

.github/workflows/trademark-cla-approval.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Generate Token
1616
id: generate-token
1717
continue-on-error: true
18-
uses: actions/create-github-app-token@v1
18+
uses: actions/create-github-app-token@v2
1919
with:
2020
app-id: "${{ secrets.WORKFLOW_AUTH_PUBLIC_APP_ID }}"
2121
private-key: "${{ secrets.WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY }}"

.github/workflows/trademark-cla-notice.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Generate Token
2020
id: generate-token
2121
continue-on-error: true
22-
uses: actions/create-github-app-token@v1
22+
uses: actions/create-github-app-token@v2
2323
with:
2424
app-id: "${{ secrets.WORKFLOW_AUTH_PUBLIC_APP_ID }}"
2525
private-key: "${{ secrets.WORKFLOW_AUTH_PUBLIC_PRIVATE_KEY }}"

docs/_snippets/_clickhouse_mysql_cloud_setup.mdx

Lines changed: 71 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -4,75 +4,107 @@ import mysql_3 from '@site/static/images/_snippets/mysql3.png';
44
import mysql_4 from '@site/static/images/_snippets/mysql4.png';
55
import mysql_5 from '@site/static/images/_snippets/mysql5.png';
66
import Image from '@theme/IdealImage';
7+
import {VerticalStepper} from "@clickhouse/click-ui/bundled";
78

8-
<br/>
9-
1. After creating your ClickHouse Cloud Service, on the `Connect your app` screen, select MySQL from the drop down.
10-
<br/>
9+
<VerticalStepper headerLevel="h4">
1110

12-
<Image size="md" img={mysql_1} alt="ClickHouse Cloud credentials screen showing MySQL interface selection dropdown" border />
11+
#### Select `Connect your app` {#select-connect-your-app}
1312

14-
2. Toggle the switch to enable the MySQL interface for this specific service. This will expose port `3306` for this service and prompt you with your MySQL connection screen that include your unique MySQL username.
13+
After creating your ClickHouse Cloud Service, on the `Connect your app` screen, select MySQL from the drop down.
1514

16-
<Image size="md" img={mysql_2} alt="ClickHouse Cloud MySQL interface enabling toggle and connection details" border />
17-
<br/>
15+
<Image size="lg" img={mysql_1} alt="ClickHouse Cloud credentials screen showing MySQL interface selection dropdown" border />
16+
17+
#### Enable the MySQL interface {#enable-mysql-interface}
18+
19+
Toggle the switch to enable the MySQL interface for this specific service.
20+
This will expose port `3306` for this service and prompt you with a MySQL connection screen that includes your unique MySQL username.
21+
22+
<Image size="lg" img={mysql_2} alt="ClickHouse Cloud MySQL interface enabling toggle and connection details" border />
1823

1924
Alternatively, in order to enable the MySQL interface for an existing service:
2025

21-
3. Ensure your service is in `Running` state then click on the service you want to enable the MySQL interface for. Select "Connect" from the left menu:
26+
#### Select `Connect` {#select-connect}
27+
28+
Ensure your service is in `Running` state then click on the service you want to enable the MySQL interface for.
29+
Select "Connect" from the left menu:
30+
31+
<Image size="lg" img={mysql_3} alt="ClickHouse Cloud service connection screen with Connect option highlighted" border />
2232

23-
<br/>
24-
<Image size="md" img={mysql_3} alt="ClickHouse Cloud service connection screen with Connect option highlighted" border />
25-
<br/>
33+
#### Choose `MySQL` {#choose-mysql}
2634

27-
4. Select MySQL from the `Connect With` drop down.
35+
Select `MySQL` from the `Connect With` drop down.
2836

29-
<br/>
3037
<Image size="md" img={mysql_4} alt="ClickHouse Cloud connection screen showing MySQL option selection" border />
31-
<br/>
3238

33-
5. Toggle the switch to enable the MySQL interface for this specific service. This will expose port `3306` for this service and prompt you with your MySQL connection screen that include your unique MySQL username.
39+
#### Enable the MySQL interface {#enable-mysql-interface}
40+
41+
Toggle the switch to enable the MySQL interface for this specific service.
42+
This will expose port `3306` for this service and prompt you with your MySQL connection screen that include your unique MySQL username.
43+
44+
</VerticalStepper>
3445

3546
<Image size="md" img={mysql_5} alt="ClickHouse Cloud connection screen with MySQL interface enabled showing connection details" border />
3647

37-
## Creating multiple MySQL users in ClickHouse Cloud {#creating-multiple-mysql-users-in-clickhouse-cloud}
48+
## Creating a readonly MySQL user in ClickHouse Cloud {#creating-multiple-mysql-users-in-clickhouse-cloud}
3849

39-
By default, there is a built-in `mysql4<subdomain>` user, which uses the same password as the `default` one. The `<subdomain>` part is the first segment of your ClickHouse Cloud hostname. This format is necessary to work with the tools that implement secure connection, but don't provide [SNI information in their TLS handshake](https://www.cloudflare.com/learning/ssl/what-is-sni), which makes it impossible to do the internal routing without an extra hint in the username (MySQL console client is one of such tools).
50+
ClickHouse Cloud automatically creates a `mysql4<subdomain>` user that shares the same password as the default user.
51+
The `<subdomain>` portion corresponds to the first part of your ClickHouse Cloud hostname.
4052

41-
Because of this, we _highly recommend_ following the `mysql4<subdomain>_<username>` format when creating a new user intended to be used with the MySQL interface, where `<subdomain>` is a hint to identify your Cloud service, and `<username>` is an arbitrary suffix of your choice.
53+
This username format is required for compatibility with tools that establish secure connections but don't include [SNI (Server Name Indication)](https://www.cloudflare.com/learning/ssl/what-is-sni) data in their TLS handshake.
54+
Without SNI information, the system cannot perform proper internal routing, so the subdomain hint embedded in the username provides the necessary routing information.
55+
The MySQL console client is an example of a tool that requires this.
4256

4357
:::tip
44-
For ClickHouse Cloud hostname like `foobar.us-east1.aws.clickhouse.cloud`, the `<subdomain>` part equals to `foobar`, and a custom MySQL username could look like `mysql4foobar_team1`.
58+
A recommended best practice is to create a new readonly MySQL user.
4559
:::
4660

47-
You can create extra users to use with the MySQL interface if, for example, you need to apply extra settings.
61+
:::note
62+
For a ClickHouse Cloud hostname like `foobar.us-east1.aws.clickhouse.cloud`, the `<subdomain>` part equals to `foobar`, and a custom MySQL username could look like `mysql4foobar_team1`.
63+
:::
4864

49-
1. Optional - create a [settings profile](/sql-reference/statements/create/settings-profile) to apply for your custom user. For example, `my_custom_profile` with an extra setting which will be applied by default when we connect with the user we create later:
65+
<VerticalStepper headerLevel="h4">
5066

51-
```sql
52-
CREATE SETTINGS PROFILE my_custom_profile SETTINGS prefer_column_name_to_alias=1;
53-
```
67+
#### Create a readonly settings profile {#create-a-custom-settings-user}
5468

55-
`prefer_column_name_to_alias` is used just as an example, you can use other settings there.
56-
2. [Create a user](/sql-reference/statements/create/user) using the following format: `mysql4<subdomain>_<username>` ([see above](#creating-multiple-mysql-users-in-clickhouse-cloud)). The password must be in double SHA1 format. For example:
69+
Create a [settings profile](/sql-reference/statements/create/settings-profile) to apply to your readonly user,
70+
setting the `readonly` setting to `1`:
5771

58-
```sql
59-
CREATE USER mysql4foobar_team1 IDENTIFIED WITH double_sha1_password BY 'YourPassword42$';
60-
```
72+
```sql
73+
CREATE SETTINGS PROFILE readonly_profile SETTINGS readonly = 1
74+
```
6175

62-
or if you want to use a custom profile for this user:
76+
#### Create a new readonly MySQL user {#create-a-readonly-mysql-user}
6377

64-
```sql
65-
CREATE USER mysql4foobar_team1 IDENTIFIED WITH double_sha1_password BY 'YourPassword42$' SETTINGS PROFILE 'my_custom_profile';
66-
```
78+
[Create a user](/sql-reference/statements/create/user) with a name following this format:
6779

68-
where `my_custom_profile` is the name of the profile you created earlier.
69-
3. [Grant](/sql-reference/statements/grant) the new user the necessary permissions to interact with the desired tables or databases. For example, if you want to grant access to `system.query_log` only:
80+
```sql
81+
mysql4<subdomain>_<username>
82+
```
83+
84+
Apply the `readonly_profile` to the new user and make sure that the password is in double SHA1 format. For example:
85+
86+
```sql
87+
CREATE USER mysql4foobar_readonly
88+
IDENTIFIED WITH double_sha1_password BY 'YourPassword42$'
89+
SETTINGS PROFILE 'readonly_profile';
90+
```
91+
92+
#### Grant the new user permissions to access the desired tables {#grant-the-new-user-the-necessary-permissions}
93+
94+
[Grant](/sql-reference/statements/grant) the new user the necessary permissions to interact with the desired tables or databases.
95+
For example, if you want to grant access to `system.query_log` only:
96+
97+
```sql
98+
GRANT SELECT ON system.query_log TO mysql4foobar_readonly;
99+
```
100+
101+
:::note
102+
For the readonly user, make sure to only grant `SELECT` permissions to the tables you want to access.
103+
:::
70104

71-
```sql
72-
GRANT SELECT ON system.query_log TO mysql4foobar_team1;
73-
```
105+
The newly created user can be used to connect to your ClickHouse Cloud service with the MySQL interface.
74106

75-
4. Use the created user to connect to your ClickHouse Cloud service with the MySQL interface.
107+
</VerticalStepper>
76108

77109
### Troubleshooting multiple MySQL users in ClickHouse Cloud {#troubleshooting-multiple-mysql-users-in-clickhouse-cloud}
78110

0 commit comments

Comments
 (0)