Failed to connect to localhost:1433 - Could not connect (sequence)
See original GitHub issueIssue type: [X ] question
Database system/driver:
[X] mssql
TypeORM version:
[X] latest
Hi everyone,
I’m new to typeorm
. For now, I’m trying to connect to my local sql server which is:
Server name: .\SQLEXPRESS
Port: 1433
(default)
This is my configuration file (ormconfig.json
):
{
"type": "mssql",
"host": "localhost",
"port": 1433,
"username": "sa",
"password": "mypassword",
"database": "HelloWorld",
"synchronize": true,
"logging": false,
"entities": [
"src/entity/**/*.ts"
],
"migrations": [
"src/migration/**/*.ts"
],
"subscribers": [
"src/subscriber/**/*.ts"
],
"cli": {
"entitiesDir": "src/entity",
"migrationsDir": "src/migration",
"subscribersDir": "src/subscriber"
}
}
When I typed npm run start
in my command prompt window, it threw me an error: Failed to connect to localhost:1433 - Could not connect (sequence)
If I connect to my database using SMSS tool, it worked normally.
I’ve tried following this solution to turn on TCP connection of my database, but it still didn’t work.
What am I doing wrong ?
Thank you.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Node.js MSSQL tedius ConnectionError: Failed to connect to ...
Apart from setting TCP port no to 1433. If you are getting "Connection lost - Cannot call write after a stream was destroyed"...
Read more >connectionerror: failed to connect to localhost:1433 - could not ...
First check whether you are able to connect to Sql Server Management Studio or not. If first point works then check Sql Server(InstanceName)...
Read more >Node.js MSSQL ConnectionError: Failed to connect to ...
Today I was trying Node.js to connect to SQL Server, the connection to the sql server failed ... message: 'Failed to conncet to...
Read more >Unable to start MSSQL Server: Server TCP provider failed to ...
Another MSSQL server uses TCP port 1433. Resolution. Connect to the server via RDP and customize TCP port for particular SQL Server version:....
Read more >Microsoft/mssql-developers - Gitter
Connecting to SQL Server 2000 , ConnectionError ESOCKET Socket error. ... Failed to connect to localhost:1433 - Could not connect (sequence)
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @IbraBach,
Try below steps:
Try this I hope this should work.
Finally I resolved my issue.
I forgot turning on
SQL Server Browser
service on my machine.I followed those steps to turning on SQL Server Browser.
I used
JetBrain DataGrip
tool to try to connect to my database, it detected my port was65269
instead of1433
.I think this issue can be closed.