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"
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With