localhost:1433
Port 1433 is Microsoft SQL Server — the enterprise database behind countless .NET applications, SharePoint, and Windows-based systems. If you're in the Microsoft ecosystem, you'll connect here.
Connect to SQL Server
SQLCMD
# Windows Authentication
sqlcmd -S localhost
# SQL Authentication
sqlcmd -S localhost -U sa -P YourPassword
# Specify port explicitly
sqlcmd -S localhost,1433 -U sa -P YourPassword
Connection Strings
# .NET
Server=localhost,1433;Database=mydb;User Id=sa;Password=pass;
# Node.js (mssql)
const config = {
server: 'localhost',
port: 1433,
user: 'sa',
password: 'password',
database: 'mydb'
};
# Python (pyodbc)
conn = pyodbc.connect(
'DRIVER={ODBC Driver 17 for SQL Server};'
'SERVER=localhost,1433;'
'DATABASE=mydb;'
'UID=sa;PWD=password'
)
Check SQL Server Status
# Windows Services
# Check "SQL Server (MSSQLSERVER)" service
# Command line
sc query MSSQLSERVER
# PowerShell
Get-Service MSSQLSERVER
Common Errors
| Error | Solution |
|---|---|
| Cannot connect | Enable TCP/IP in SQL Server Config Manager |
| Login failed | Enable SQL Server Authentication mode |
| Port blocked | Add firewall rule for port 1433 |
Enable TCP/IP
- Open SQL Server Configuration Manager
- SQL Server Network Configuration → Protocols
- Enable TCP/IP
- Set TCP Port to 1433
- Restart SQL Server service
Docker SQL Server
docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=YourPass123!" \
-p 1433:1433 \
mcr.microsoft.com/mssql/server:2022-latest