From 21cec24e75a34e43f65e61a7edde5361be3e1e13 Mon Sep 17 00:00:00 2001 From: LRcoding <38545827+LwClick@users.noreply.github.com> Date: Fri, 3 Jul 2026 13:47:47 +0800 Subject: [PATCH] fix(mysql): support cleartext password auth option (#2499) --- .../connection/ConnectionDialog.vue | 20 +++++- apps/desktop/src/i18n/locales/en.ts | 2 + apps/desktop/src/i18n/locales/es.ts | 2 + apps/desktop/src/i18n/locales/it.ts | 2 + apps/desktop/src/i18n/locales/ja.ts | 2 + apps/desktop/src/i18n/locales/pt-BR.ts | 2 + apps/desktop/src/i18n/locales/zh-CN.ts | 2 + apps/desktop/src/i18n/locales/zh-TW.ts | 2 + .../__tests__/mysqlConnectionOptions.spec.ts | 19 +++++ .../desktop/src/lib/mysqlConnectionOptions.ts | 31 +++++++++ crates/dbx-core/src/db/mysql.rs | 35 ++++++++++ crates/dbx-core/src/models/connection.rs | 69 +++++++++++++++++++ 12 files changed, 187 insertions(+), 1 deletion(-) create mode 100644 apps/desktop/src/lib/__tests__/mysqlConnectionOptions.spec.ts create mode 100644 apps/desktop/src/lib/mysqlConnectionOptions.ts diff --git a/apps/desktop/src/components/connection/ConnectionDialog.vue b/apps/desktop/src/components/connection/ConnectionDialog.vue index 9503899c2..669654248 100644 --- a/apps/desktop/src/components/connection/ConnectionDialog.vue +++ b/apps/desktop/src/components/connection/ConnectionDialog.vue @@ -31,6 +31,7 @@ import { firstZooKeeperEndpoint, normalizeZooKeeperConnectString } from "@/lib/z import { isLocalFileTypeDb } from "@/lib/connectionFile"; import { MQ_PINNED_VERSION_OPTIONS, pinnedVersionToSelection, selectionToPinnedVersion } from "@/lib/mqPinnedVersionOptions"; import { mongodbAuthFailureHint, mongoUrlParam, setMongoUrlParam } from "@/lib/mongoConnectionOptions"; +import { mysqlCleartextPasswordAuthEnabled, setMysqlCleartextPasswordAuthEnabled } from "@/lib/mysqlConnectionOptions"; import { copyToClipboard } from "@/lib/clipboard"; import { agentDriverInstallKey, appendAgentDriverUpdateHint, hasAgentDriverUpdate, showAgentDriverInstallHint, type AgentDriverInstallState } from "@/lib/agentDriverInstallHint"; import { prestoSqlBuiltinDriverPaths } from "@/lib/prestoSqlBuiltinDriver"; @@ -1593,6 +1594,13 @@ const supportsCaCertificatePath = computed(() => form.value.db_type === "clickho const supportsGenericUrlParams = computed(() => form.value.db_type !== "manticoresearch"); const bareMysqlProfiles = new Set(["doris", "selectdb", "oceanbase"]); const supportsMysqlTlsOptions = computed(() => form.value.db_type === "starrocks" || (form.value.db_type === "mysql" && !bareMysqlProfiles.has(selectedType.value))); +const supportsMysqlCleartextPasswordAuth = computed(() => form.value.db_type === "mysql" && !bareMysqlProfiles.has(selectedType.value)); +const mysqlCleartextPasswordAuth = computed({ + get: () => mysqlCleartextPasswordAuthEnabled(form.value.url_params), + set: (value: boolean) => { + form.value.url_params = setMysqlCleartextPasswordAuthEnabled(form.value.url_params, value); + }, +}); const mysqlTlsMode = computed({ get: () => mysqlTlsModeFromParams(form.value.url_params, form.value.ssl), set: (value: string) => { @@ -4204,7 +4212,7 @@ function openExternalUrl(url: string) { -
+