Lost SQL credentials and unable to connect to SQL via SQLCMD I have a machine running SQL 2014 but have neither the windows authentication or sa authentication details due to mismanagement of a previous support team. 

Having tried logging in to SQL Management Studio using my Microsoft AD account I received the following error:


  ===Cannot connect to BACKUP-MGMT-01\CONSULT.===
  A connection was successfully established with the server, but then an error occurred during the login process. (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.) (.Net SqlClient Data Provider)


I suspect this is due to my account not having privileges.

I then found some steps online allowing you to add a new sa or windows authenticated user via SQLCMD. However, when I run either the SQLCMD -S .\BACKUP-MGMT-01\CONSULT or SQLCMD -S .\BACKUP-MGMT-01 I just receive the following error:


  C:\Users\frank>SQLCMD -S .\BACKUP-MGMT-01\CONSULT
  Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : SQL Server Network Inte
  rfaces: Error Locating Server/Instance Specified [xFFFFFFFF]. .
  Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : Login timeout expired.
  Sqlcmd: Error: Microsoft ODBC Driver 11 for SQL Server : A network-related or in
  stance-specific error has occurred while establishing a connection to SQL Server
  . Server is not found or not accessible. Check if instance name is correct and i
  f SQL Server is configured to allow remote connections. For more information see
   SQL Server Books Online..


Can anybody assist?
The correct format of the parameter -S for the SQLCMD prompt is: Server\Instance. 

You seem to have tried localhost\instance\database which doesn't work.

SQLCMD -S .\BACKUP-MGMT-01\CONSULT 
          ^^        ^     ^   ^
          ||        |     |   +--- Database 
          ||        |     +------- Separator
          ||        +------------- Instance
          |+---------------------- Separator
          +----------------------- Server (. = localhost)


In any case the error message is stating you are having issues with the server name and/or instance name.

If your server is named BACKUP-MGMT-01 and your instance is named CONSULT then you might want to try:

SQLCMD -S BACKUP-MGMT-01\CONSULT -E 


If your instance is really named BACKUP-MGMT-01 then you might want to try:

SQLCMD -S .\BACKUP-MGMT-01 -E -d CONSULT


Where -d is the parameter for database and -E is for trusted connections.

Reference Reading

sqlcmd Utility (Microsoft | Docs | SQL Docs)