dotnet ef scaffold login fails for user sa on a SqlServer MacOS/Linux

.net-core entity-framework-core linux macos sql-server

Question

I'm executing this command, and definitely using the correct password, but yet it keeps telling me that the login failed.

My password is using a special character ($), and I've read that I should be using quotes to make a string literal, but it does not work on MacOS/Linux.

dotnet ef dbcontext scaffold "Server=.;Database=MY_DB;Trusted_Connection=False;User ID=sa;Password=$MYPASSWORD" Microsoft.EntityFrameworkCore.SqlServer -o Models -c "DbContext"
1
4
3/23/2018 1:58:01 PM

Accepted Answer

In order to escape the $ on the connection string, you should be escaping the string using \ as such dotnet ef dbcontext scaffold "Server=.;Database=MY_DB;Trusted_Connection=False;User ID=sa;Password=\$MYPASSWORD" Microsoft.EntityFrameworkCore.SqlServer -o Models -c "DbContext" instead.

0
3/23/2018 1:58:01 PM

Popular Answer

I came across this issue.

Switch out your double quotes for single quotes and you should be able to execute in terminal.

dotnet ef dbcontext scaffold 'Server=.;Database=MY_DB;Trusted_Connection=False;User ID=sa;Password=$MYPASSWORD' Microsoft.EntityFrameworkCore.SqlServer -o Models -c "DbContext"

Here is a link to special characters that need to be escaped. https://askubuntu.com/a/278695/325994



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow