snippetsqlMinor
How do I log into the Dedicated Admin Console (DAC) on Linux?
Viewed 0 times
theadminlogintodacdedicatedlinuxhowconsole
Problem
sqlcmd is documented to have,Login-Related Options
-ALogs in to SQL Server with a Dedicated Administrator Connection (DAC). This kind of connection is used to troubleshoot a server. This will only work with server computers that support DAC. If DAC is not available, sqlcmd generates an error message and then exits. For more information about DAC, see Diagnostic Connection for Database Administrators. The
-A option is not supported with the -G option. When connecting to SQL Database using -A, you must be a SQL server administrator. The DAC is not availble for an Azure Active Directory adminstrator.Solution
Clients
There are two Linux clients from Microsoft that can connect to SQL Server's Dedicated Administrator Connection (DAC),
-
-
Server Settings
If connecting from outside
There are two Linux clients from Microsoft that can connect to SQL Server's Dedicated Administrator Connection (DAC),
-
mssql-cli. Versions newer than 0.90 have the -A option to connect to the Dedicated Administrator Connection (DAC). (QUOTED_IDENTIFIERS is on by default).mssql-cli -S localhost -U sa -A-
sqlcmd. This is the older client that ships with the mssql-tools package. It should never be used. If you insist on using it, you'll have to get accustomed to GO. Don't foget to always use -I with sqlcmd to turn on QUOTED_IDENTIFIERS. No idea why Microsoft chose the admin: prefix for sqlcmd. On most other clients, they use -A flag.sqlcmd -I -S admin:localhost -U saServer Settings
If connecting from outside
localhost you may have to enable remote DAC first. To do that simply runsp_configure 'remote admin connections', 1
GO
RECONFIGURE
GOCode Snippets
mssql-cli -S localhost -U sa -Asqlcmd -I -S admin:localhost -U sasp_configure 'remote admin connections', 1
GO
RECONFIGURE
GOContext
StackExchange Database Administrators Q#192949, answer score: 4
Revisions (0)
No revisions yet.