Nikos
Nikos

Reputation: 1

Can't connect AdonisJS to SQL Server database

I use AdonisJS and SQL Server. I'm trying to connect my application to SQL Server, but it's not working. It works if I connect with SQL Server Management Studio:

enter image description here

But when I try to make a migration, I get an error. Here is my config/database.js: https://hasteb.in/odixoxom.kotlin

My .env :

DB_CONNECTION=mssql
DB_HOST=127.0.0.1
DB_PORT=1433
DB_USER=sa
DB_SERVER=DIDI-PC
DB_PASSWORD=123456
DB_DATABASE=WEB_PANEL

Does someone have a solution? Thanks!

Upvotes: 0

Views: 1157

Answers (1)

Nikos
Nikos

Reputation: 1

I have the answer :)

it doesn't work like with mysql, there I have to create the db first and then access it, with mysql it was adonisjs who did it it it seems to me :)

And the "sa" username is just for testing haha, don't worries

Thanks !!

Upvotes: 0

Related Questions