When you face this issue, some googling will land you on this page. To fix this, all you really need to do is change your default database to master.
In your Sql management studio -> connect -> connection properties -> change Connect to database = "master" or some database you have in your local machine and hit connect.
It might look something like this.
No need to use sqlcmd to do the dirty job.