Question

On Linux, whenever I run use mssqlsystemresource to get access to Resource Database, I get an error. How do I resolve this.

1> use mssqlsystemresource
2> go
Msg 911, Level 16, State 1, Server x230, Line 1
Database 'mssqlsystemresource' does not exist. Make sure that the name is entered correctly.

When I try to log in with sqlcmd with DAC (admin:) targeting the database with -d

$ sqlcmd -I -S admin:localhost -U sa -d mssqlsystemresource -P Password0
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Cannot open database "mssqlsystemresource" requested by the login. The login failed..
Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login failed for user 'sa'..

When I try to log in with mssql-cli's -A, I get

$ mssql-cli -A -d mssqlsystemresource
Username (press enter for sa): 
Password: 

Connection did not succeed.
Error message: Cannot open database "mssqlsystemresource" requested by the login. The login failed.
Login failed for user 'sa'.
Unable to connect. Please try again
Was it helpful?

Solution

The mssqlsystemresource database is only available in single-user mode. On Linux, that means

sudo systemctl stop mssql-server
sudo -u mssql /opt/mssql/bin/sqlservr -m
Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top