0

I have linux ubuntu 16.04 and running MSSQL Server express Service is up and running.

sudo systemctl status mssql-server

result

mssql-server.service - Microsoft SQL Server Database Engine
   Loaded: loaded (/lib/systemd/system/mssql-server.service; enabled; vendor pre
   Active: active (running) since Fri 2020-11-06 08:11:42 GMT; 2h 0min ago
     Docs: https://docs.microsoft.com/en-us/sql/linux
 Main PID: 961 (sqlservr)
   CGroup: /system.slice/mssql-server.service
           ├─ 961 /opt/mssql/bin/sqlservr
           └─1608 /opt/mssql/bin/sqlservr

I opened in terminal this path:

/opt/mssql-tools/bin$

I entered the path to access but

/opt/mssql-tools/bin$

sqlcmd -s SQLEXPRESS -u SA (Here password)

but i did not get anything, only this:

Sqlcmd: 'SA': Unexpected argument. Enter '-?' for help.

Long time ago i did not connect so i may have forgotten the creds>. So now my question are:

How to find the credentials (Username but especially SQL Server name? ) in the system? Are they stored in any conf file apart MSSQL.CONF where i did not find them? Is there a way to get them from the terminal? IF they are not wrong, what is wrong, then>? Why i got that errors? I Was able to connect around 2 months ago.

Thanks to everyone.

Paolo

2 Answers 2

0

I understood i can avoid the password -P once i do that, it asks me to enter it i do it and it comes the error Password: Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Login timeout expired. Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL

Server : TCP Provider: Error code 0x2AF9.
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : A network-related or instance-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 if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online..

the password is correct and the Service is running. any idea? Thanks.

0

The -u is your problem. It should be a capital: -U

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .