Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.
To add a SQL Server database, go to Instances, click Connect instance, and choose MSSQL.Bytebase lists every database on the server except master, model, msdb, and tempdb as a Bytebase database. On Amazon RDS, it also skips rdscore. See Database.
On a self-managed server, create a login for Bytebase and add it to sysadmin. The examples name the login bytebase.
CREATE LOGIN bytebase WITH PASSWORD = '<password>';ALTER SERVER ROLE sysadmin ADD MEMBER bytebase;
On Amazon RDS for SQL Server, the master user isn’t a member of sysadmin and can’t add other logins to it. Create the login as the master user instead, and make it db_owner in each database Bytebase manages:
CREATE LOGIN bytebase WITH PASSWORD = '<password>';-- Repeat in each database that Bytebase manages.USE <database>;CREATE USER bytebase FOR LOGIN bytebase;ALTER ROLE db_owner ADD MEMBER bytebase;
The host name or IP address of the SQL Server instance, such as db.example.com. For an Availability Group, use the listener, as described in Availability Groups.
The database Bytebase connects to when it isn’t working in a specific database, such as when it tests the connection or lists databases. If you leave it empty, SQL Server uses the login’s default database.
Bytebase doesn’t verify the SQL Server certificate yet. It trusts whatever certificate the server presents, the same as TrustServerCertificate=true, and the TLS settings in the form don’t change that. This is a known issue, and a fix is in progress.
By default, only the login is encrypted. To encrypt the whole session, add encrypt with the value true under Extra Parameters, or have the server force encryption. In both cases the session is encrypted, but the server’s identity isn’t checked. Client certificates aren’t available for SQL Server.
Options that Bytebase passes to the driver as key-value pairs, using the driver’s parameter names such as encrypt, multisubnetfailover, and applicationintent. Bytebase sets TrustServerCertificate itself, so adding it here fails.
Set Hostname to the Availability Group listener, not a server name. The listener follows the primary across failovers. Bytebase syncs every database on the server behind the listener, including secondaries of other Availability Groups, so use Sync Databases to limit the instance to this group’s databases.Under Extra Parameters, add multisubnetfailover with the value true if the group spans subnets. To serve reads from a readable secondary, add applicationintent with the value ReadOnly on the read-only connection.
A read-only connection has its own Extra Parameters. Set encrypt there too if the read-only connection should be encrypted.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Bytebase Docs","colors":{"primary":"#2b66ff","light":"#4faaff","dark":"#1c49be"},"logo":{"light":"https://mintcdn.com/dbx/vw8BbfZhlW9y-cr_/images/logo/logo-full.png?fit=max\u0026auto=format\u0026n=vw8BbfZhlW9y-cr_\u0026q=85\u0026s=894c5021793b82b6bcef8b09cef3d85d","dark":"https://mintcdn.com/dbx/vw8BbfZhlW9y-cr_/images/logo/logo-full-white.png?fit=max\u0026auto=format\u0026n=vw8BbfZhlW9y-cr_\u0026q=85\u0026s=9f660755d7e64c8f3d4882e66589af29"},"favicon":"https://mintcdn.com/dbx/otHCKEZkOwO4gA2D/favicon.svg?fit=max\u0026auto=format\u0026n=otHCKEZkOwO4gA2D\u0026q=85\u0026s=a7e205f761697f5ffcec570fa5de78b0","navbar":{"links":[{"href":"https://www.bytebase.com","label":"bytebase.com"}],"primary":{"type":"button","label":"Try Cloud","href":"https://cloud.bytebase.com/"}},"footer":{"socials":{"x":"https://x.com/bytebase","github":"https://github.com/bytebase/bytebase","linkedin":"https://linkedin.com/company/bytebase"}},"seo":{"metatags":{"canonical":"https://docs.bytebase.com"}},"icons":{"library":"lucide"},"integrations":{"ga4":{"measurementId":"G-4BZ4JH7449"}},"errors":{"404":{"redirect":false}},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"dbx","hasAudioNarration":false,"actualSubdomain":"dbx","customDomains":["docs.bytebase.com"],"gitSource":{"type":"github","owner":"bytebase","repo":"bytebase.com","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6ae03028c71f9056d945c05b","collectionId":"ff67c486-1c2b-4d7a-a0ba-22e76946bc7c","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6ae03028c71f9056d945c05b"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ae03028c71f9056d945c05b","clientVersion":"0.0.4044","searchFilterCounts":[{"language":"default","tag":"Changelog","count":53},{"language":"default","tag":"Change Management","count":46},{"language":"default","tag":"Get Started","count":43},{"language":"default","tag":"Tutorials","count":41},{"language":"default","tag":"Administration","count":32},{"language":"default","tag":"GitOps Workflow","count":24},{"language":"default","tag":"Access Control","count":23},{"language":"default","tag":"Security","count":19},{"language":"default","tag":"UI-Driven Workflow","count":15},{"language":"default","tag":"Install","count":11}]},"assistantConfig":{"enableAskAiButton":true,"enableAskAiSearchBar":false,"deflection":{"enabled":true,"email":"help@bytebase.com"}},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[{"filePath":"demo-embed.css","content":".demo-embed{position:relative;display:block;margin:1.5rem 0;border:0;border-radius:0;cursor:zoom-in;text-decoration:none!important}.demo-embed img{display:block;width:100%;margin:0!important;border-radius:0!important}.demo-embed::after{content:\"Play the interactive demo\";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:.5rem .875rem .5rem 2.25rem;border:1px solid rgb(228 228 231);border-radius:9999px;background:rgb(255 255 255/.96) no-repeat .875rem center/1rem 1rem url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2318181b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3'/%3E%3C/svg%3E\");color:rgb(24 24 27);font-size:.8125rem;font-weight:500;line-height:1.25rem;box-shadow:0 2px 8px rgb(0 0 0/.12);transition:transform .15s ease}.demo-embed:hover::after{transform:translate(-50%,-50%) scale(1.04)}.demo-dialog{position:fixed;inset:0;margin:auto;width:min(96vw,calc((100vh - 5rem)*792/480),1352px);max-width:none;max-height:none;padding:0;border:0;background:0 0;box-shadow:none;overflow:visible}.demo-dialog::backdrop{background:rgb(255 255 255/.85);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}html.dark .demo-dialog::backdrop{background:rgb(9 9 11/.85)}.demo-dialog iframe{display:block;width:100%;aspect-ratio:792/480;border:0}.demo-dialog__close{position:fixed;top:1rem;right:1rem;display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;border:1px solid rgb(228 228 231);border-radius:9999px;background:#fff;color:rgb(24 24 27);font-size:1.25rem;line-height:1;cursor:pointer}html.dark .demo-dialog__close{border-color:rgb(63 63 70);background:rgb(24 24 27);color:#fff}"}],"page":{"pagePath":"get-started/connect/sql-server","slug":"/get-started/connect/sql-server","pageMetadata":{"title":"SQL Server","description":"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.","href":"/get-started/connect/sql-server"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`To add a SQL Server database, go to `,_jsx(_components.strong,{children:`Instances`}),`, click `,_jsx(_components.strong,{children:`Connect instance`}),`, and choose `,_jsx(_components.strong,{children:`MSSQL`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Bytebase lists every database on the server except `,_jsx(_components.code,{children:`master`}),`, `,_jsx(_components.code,{children:`model`}),`, `,_jsx(_components.code,{children:`msdb`}),`, and `,_jsx(_components.code,{children:`tempdb`}),` as a Bytebase database. On Amazon RDS, it also skips `,_jsx(_components.code,{children:`rdscore`}),`. See `,_jsx(_components.a,{href:`/concepts/database`,children:`Database`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`supported-versions`,children:`Supported versions`}),`\n`,_jsx(_components.p,{children:`Bytebase supports Microsoft SQL Server 2019 and later. It connects through a built-in driver, so there is nothing to install.`}),`\n`,_jsx(Heading,{level:`2`,id:`create-a-user-for-bytebase`,children:`Create a user for Bytebase`}),`\n`,_jsxs(_components.p,{children:[`On a self-managed server, create a login for Bytebase and add it to `,_jsx(_components.code,{children:`sysadmin`}),`. The examples name the login `,_jsx(_components.code,{children:`bytebase`}),`.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` LOGIN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bytebase `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WITH`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` PASSWORD`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cpassword>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` SERVER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` sysadmin `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ADD`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MEMBER bytebase;`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`On Amazon RDS for SQL Server, the master user isn’t a member of `,_jsx(_components.code,{children:`sysadmin`}),` and can’t add other logins to it. Create the login as the master user instead, and make it `,_jsx(_components.code,{children:`db_owner`}),` in each database Bytebase manages:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`sql`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`sql`,children:_jsxs(_components.code,{language:`sql`,numberOfLines:`5`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` LOGIN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bytebase `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`WITH`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` PASSWORD`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '\u003cpassword>'`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:`-- Repeat in each database that Bytebase manages.`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`USE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u003c`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`database`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`>`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`CREATE`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` USER`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` bytebase`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` FOR`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` LOGIN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` bytebase;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ALTER`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` ROLE`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` db_owner `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`ADD`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` MEMBER bytebase;`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`connection-details`,children:`Connection details`}),`\n`,_jsx(Heading,{level:`3`,id:`authentication`,children:`Authentication`}),`\n`,_jsx(_components.p,{children:`How Bytebase signs in:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Plain Password`}),`: the `,_jsx(_components.strong,{children:`Username`}),` and `,_jsx(_components.strong,{children:`Password`}),` below.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.strong,{children:`Azure IAM`}),`: a Microsoft Entra identity, for Azure SQL. See `,_jsx(_components.a,{href:`/get-started/connect/azure`,children:`Azure`}),`.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`3`,id:`hostname`,children:`Hostname`}),`\n`,_jsxs(_components.p,{children:[`The host name or IP address of the SQL Server instance, such as `,_jsx(_components.code,{children:`db.example.com`}),`. For an Availability Group, use the listener, as described in `,_jsx(_components.a,{href:`#availability-groups`,children:`Availability Groups`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`port`,children:`Port`}),`\n`,_jsxs(_components.p,{children:[`The server port. SQL Server’s default is `,_jsx(_components.code,{children:`1433`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`username`,children:`Username`}),`\n`,_jsx(_components.p,{children:`The SQL Server login Bytebase connects as.`}),`\n`,_jsx(Heading,{level:`3`,id:`password`,children:`Password`}),`\n`,_jsxs(_components.p,{children:[`The login’s password. You can also read it from a `,_jsx(_components.a,{href:`/get-started/connect/overview#secret-manager-integration`,children:`secret manager`}),`.`]}),`\n`,_jsx(Heading,{level:`3`,id:`connection-database`,children:`Connection database`}),`\n`,_jsx(_components.p,{children:`The database Bytebase connects to when it isn’t working in a specific database, such as when it tests the connection or lists databases. If you leave it empty, SQL Server uses the login’s default database.`}),`\n`,_jsx(Heading,{level:`3`,id:`tls`,children:`TLS`}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[`Bytebase doesn’t verify the SQL Server certificate yet. It trusts whatever certificate the server presents, the same as `,_jsx(_components.code,{children:`TrustServerCertificate=true`}),`, and the `,_jsx(_components.strong,{children:`TLS`}),` settings in the form don’t change that. This is a known issue, and a fix is in progress.`]})}),`\n`,_jsxs(_components.p,{children:[`By default, only the login is encrypted. To encrypt the whole session, add `,_jsx(_components.code,{children:`encrypt`}),` with the value `,_jsx(_components.code,{children:`true`}),` under `,_jsx(_components.strong,{children:`Extra Parameters`}),`, or have the server force encryption. In both cases the session is encrypted, but the server’s identity isn’t checked. Client certificates aren’t available for SQL Server.`]}),`\n`,_jsx(Heading,{level:`3`,id:`extra-parameters`,children:`Extra Parameters`}),`\n`,_jsxs(_components.p,{children:[`Options that Bytebase passes to the driver as key-value pairs, using the `,_jsx(_components.a,{href:`https://github.com/microsoft/go-mssqldb#connection-parameters-and-dsn`,children:`driver’s parameter names`}),` such as `,_jsx(_components.code,{children:`encrypt`}),`, `,_jsx(_components.code,{children:`multisubnetfailover`}),`, and `,_jsx(_components.code,{children:`applicationintent`}),`. Bytebase sets `,_jsx(_components.code,{children:`TrustServerCertificate`}),` itself, so adding it here fails.`]}),`\n`,_jsx(Heading,{level:`2`,id:`availability-groups`,children:`Availability Groups`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.strong,{children:`Hostname`}),` to the Availability Group listener, not a server name. The listener follows the primary across failovers. Bytebase syncs every database on the server behind the listener, including secondaries of other Availability Groups, so use `,_jsx(_components.a,{href:`/get-started/connect/overview#sync-databases`,children:`Sync Databases`}),` to limit the instance to this group’s databases.`]}),`\n`,_jsxs(_components.p,{children:[`Under `,_jsx(_components.strong,{children:`Extra Parameters`}),`, add `,_jsx(_components.code,{children:`multisubnetfailover`}),` with the value `,_jsx(_components.code,{children:`true`}),` if the group spans subnets. To serve reads from a readable secondary, add `,_jsx(_components.code,{children:`applicationintent`}),` with the value `,_jsx(_components.code,{children:`ReadOnly`}),` on the `,_jsx(_components.a,{href:`/get-started/connect/overview#read-only-connections`,children:`read-only connection`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`troubleshooting`,children:`Troubleshooting`}),`\n`,_jsxs(_components.p,{children:[_jsx(_components.strong,{children:`Test Connection`}),` shows the error from the server or the driver:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Error`}),_jsx(_components.th,{children:`Cause`}),_jsx(_components.th,{children:`Fix`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mssql: login error: Login failed for user '…'.`})}),_jsx(_components.td,{children:`The username or password is wrong.`}),_jsx(_components.td,{children:`Check the login and its password.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`mssql: login error: Cannot open database \"…\" that was requested by the login.`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Connection database`}),` doesn’t exist, or the login can’t open it.`]}),_jsx(_components.td,{children:`Correct the name, or leave the field empty to use the login’s default database.`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`key TrustServerCertificate provided more than once`})}),_jsxs(_components.td,{children:[_jsx(_components.strong,{children:`Extra Parameters`}),` sets `,_jsx(_components.code,{children:`TrustServerCertificate`}),`, which Bytebase already sets.`]}),_jsxs(_components.td,{children:[`Remove `,_jsx(_components.code,{children:`TrustServerCertificate`}),` from `,_jsx(_components.strong,{children:`Extra Parameters`}),`.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`TLS Handshake failed: EOF`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`encrypt`}),` is set to `,_jsx(_components.code,{children:`strict`}),`, and the server doesn’t accept strict encryption.`]}),_jsxs(_components.td,{children:[`Use `,_jsx(_components.code,{children:`encrypt`}),` with the value `,_jsx(_components.code,{children:`true`}),`.`]})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`read-only-connection`,children:`Read-only connection`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.a,{href:`/get-started/connect/overview#read-only-connections`,children:`read-only connection`}),` has its own `,_jsx(_components.strong,{children:`Extra Parameters`}),`. Set `,_jsx(_components.code,{children:`encrypt`}),` there too if the read-only connection should be encrypted.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"SQL Server","description":"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.","href":"/get-started/connect/sql-server"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Supported versions","slug":"supported-versions","depth":2,"children":[]},{"title":"Create a user for Bytebase","slug":"create-a-user-for-bytebase","depth":2,"children":[]},{"title":"Connection details","slug":"connection-details","depth":2,"children":[{"title":"Authentication","slug":"authentication","depth":3,"children":[]},{"title":"Hostname","slug":"hostname","depth":3,"children":[]},{"title":"Port","slug":"port","depth":3,"children":[]},{"title":"Username","slug":"username","depth":3,"children":[]},{"title":"Password","slug":"password","depth":3,"children":[]},{"title":"Connection database","slug":"connection-database","depth":3,"children":[]},{"title":"TLS","slug":"tls","depth":3,"children":[]},{"title":"Extra Parameters","slug":"extra-parameters","depth":3,"children":[]}]},{"title":"Availability Groups","slug":"availability-groups","depth":2,"children":[]},{"title":"Troubleshooting","slug":"troubleshooting","depth":2,"children":[]},{"title":"Read-only connection","slug":"read-only-connection","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/dbx/9053740759cb8dde/demo-embed.js"],"subdomain":"dbx","siteName":"Bytebase Docs","title":"SQL Server - Bytebase Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-12T10:59:06.532Z","originalFileLocation":"get-started/connect/sql-server.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Bytebase Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"SQL Server - Bytebase Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Bytebase Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.bytebase.com/get-started/connect/sql-server\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://dbx.mintlify.app/_mintlify/api/og/v2?division=Database+Engines\u0026amp;title=SQL+Server\u0026amp;description=Connect+Bytebase+to+Microsoft+SQL+Server%2C+including+Availability+Groups+and+encryption.\u0026amp;theme=83d7e50c9104a5d993880fba\u0026amp;signature=3fa03cfede8b92f72f0b5407dc8f128fd52a05b82244f619ded69fb23df8da6a\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"SQL Server - Bytebase Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://dbx.mintlify.app/_mintlify/api/og/v2?division=Database+Engines\u0026amp;title=SQL+Server\u0026amp;description=Connect+Bytebase+to+Microsoft+SQL+Server%2C+including+Availability+Groups+and+encryption.\u0026amp;theme=83d7e50c9104a5d993880fba\u0026amp;signature=3fa03cfede8b92f72f0b5407dc8f128fd52a05b82244f619ded69fb23df8da6a\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/dbx/R2-p_QktkMNyxiB0/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Bytebase Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2b66ff\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.bytebase.com/get-started/connect/sql-server\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/get-started/connect/sql-server.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.bytebase.com/#organization\",\"name\":\"Bytebase Docs\",\"url\":\"https://docs.bytebase.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/dbx/vw8BbfZhlW9y-cr_/images/logo/logo-full.png?fit=max\u0026auto=format\u0026n=vw8BbfZhlW9y-cr_\u0026q=85\u0026s=894c5021793b82b6bcef8b09cef3d85d\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.bytebase.com#website\",\"name\":\"Bytebase Docs\",\"url\":\"https://docs.bytebase.com\",\"publisher\":{\"@id\":\"https://docs.bytebase.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.bytebase.com/get-started/connect/sql-server#webpage\",\"url\":\"https://docs.bytebase.com/get-started/connect/sql-server\",\"name\":\"SQL Server\",\"description\":\"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.\",\"dateModified\":\"2026-10-12T10:59:06.532Z\",\"isPartOf\":{\"@id\":\"https://docs.bytebase.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.bytebase.com/get-started/connect/sql-server#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.bytebase.com/get-started/connect/sql-server#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Connect Databases\",\"item\":\"https://docs.bytebase.com/get-started/connect/overview\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Database Engines\",\"item\":\"https://docs.bytebase.com/get-started/connect/mysql\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"SQL Server\",\"item\":\"https://docs.bytebase.com/get-started/connect/sql-server\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.bytebase.com/get-started/connect/sql-server#article\",\"headline\":\"SQL Server\",\"name\":\"SQL Server\",\"description\":\"Connect Bytebase to Microsoft SQL Server, including Availability Groups and encryption.\",\"url\":\"https://docs.bytebase.com/get-started/connect/sql-server\",\"mainEntityOfPage\":{\"@id\":\"https://docs.bytebase.com/get-started/connect/sql-server#webpage\"},\"dateModified\":\"2026-10-12T10:59:06.532Z\",\"publisher\":{\"@id\":\"https://docs.bytebase.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.bytebase.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Bytebase Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Bytebase Docs","nav":{"global":{"anchors":[]},"tabs":[{"tab":"Get Started","groups":[{"group":"Introduction","pages":[{"title":"What's Bytebase","href":"/introduction/what-is-bytebase"},{"title":"Supported Databases","href":"/introduction/supported-databases"},{"title":"Use Cases","href":"/introduction/use-cases"},{"title":"FAQ","href":"/faq"}]},{"group":"Quick Start","pages":[{"title":"Step 1: Start Bytebase","href":"/get-started/step-by-step/start-bytebase"},{"title":"Step 2: Connect a Database","href":"/get-started/step-by-step/add-an-instance"},{"title":"Step 3: Create a Project","href":"/get-started/step-by-step/create-a-project"},{"title":"Step 4: Change Schema","href":"/get-started/step-by-step/change-schema"},{"title":"Step 5: Query Data","href":"/get-started/step-by-step/query-data"}]},{"group":"Bytebase Essentials","pages":[{"title":"Bytebase Essentials","sidebarTitle":"Overview","href":"/concepts/overview"},{"group":"Core Concepts","pages":[{"title":"Project","href":"/concepts/project"},{"title":"Instance","href":"/concepts/instance"},{"title":"Database","href":"/concepts/database"},{"title":"Environment","href":"/concepts/environment"},{"title":"Plan","href":"/concepts/plan"},{"title":"Issue","href":"/concepts/issue"},{"title":"Release","href":"/concepts/release"},{"title":"Rollout","href":"/concepts/rollout"},{"title":"SQL Review","href":"/concepts/sql-review"}]}]},{"group":"Install","pages":[{"title":"Self-Host vs Cloud","href":"/get-started/self-host-vs-cloud"},{"title":"Cloud","href":"/get-started/cloud"},{"group":"Self-Host","pages":[{"title":"Deploy with Docker","href":"/get-started/self-host/deploy-with-docker"},{"title":"Deploy with Kubernetes","href":"/get-started/self-host/deploy-with-kubernetes"},{"title":"Configure External PostgreSQL","href":"/get-started/self-host/external-postgres"},{"title":"High Availability","href":"/get-started/self-host/high-availability"},{"title":"Network Architecture and External Access","href":"/get-started/self-host/network-architecture"},{"title":"External Access Configuration","href":"/get-started/self-host/external-access"},{"title":"Configure External URL","href":"/get-started/self-host/external-url"},{"title":"Production Setup","href":"/get-started/self-host/production-setup"},{"title":"Upgrade","href":"/get-started/self-host/upgrade"}]}]},{"group":"Connect Databases","pages":[{"title":"Overview","href":"/get-started/connect/overview"},{"group":"Database Engines","pages":[{"title":"MySQL","href":"/get-started/connect/mysql"},{"title":"PostgreSQL","href":"/get-started/connect/postgresql"},{"title":"Oracle","description":"Connect Bytebase to Oracle Database, including RAC, Data Guard, and encrypted TCPS connections with an Oracle wallet.","href":"/get-started/connect/oracle"},{"title":"SQL Server","href":"/get-started/connect/sql-server"},{"title":"MongoDB","description":"Connect Bytebase to MongoDB, including replica sets, SRV connection strings, and verified TLS.","href":"/get-started/connect/mongodb"}]},{"group":"Cloud Providers","pages":[{"title":"AWS Database Connections","sidebarTitle":"AWS","href":"/get-started/connect/aws"},{"title":"Azure Database Connections","sidebarTitle":"Azure","href":"/get-started/connect/azure"},{"title":"GCP Database Connections","sidebarTitle":"GCP","href":"/get-started/connect/gcp"}]}]},{"group":"Onboarding Guides","pages":[{"title":"Onboarding Plan","href":"/onboarding/plan"},{"title":"POC Checklist","href":"/onboarding/poc"},{"title":"SQL Editor Data Access Control","href":"/onboarding/sql-editor-data-access-control"},{"title":"Organize Resources","href":"/onboarding/organize-resources"}]}]},{"tab":"Change Management","pages":[{"title":"Change Management","href":"/change-database/change-workflow"}]},{"tab":"Access Control","pages":[{"title":"Access Control","href":"/security/database-permission/overview"}]},{"tab":"Administration","pages":[{"title":"Administration","href":"/ai-assistant"}]},{"tab":"Tutorials","pages":[{"title":"Tutorials","href":"/tutorials/risks-best-practice"}]},{"tab":"API Reference","href":"https://api.bytebase.com"},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/changelog/bytebase-3-24-0"}]}]},"basePath":"","title":"SQL Server - Bytebase Docs","buildId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","deploymentId":"dpl_DeHjVRGfFnhYQwHnfC2pjeXXv8h9","dynamics":[],"chunks":[]}