Follow the steps below to fix this:
- Open SSMS
- Connect to the desired Server
- In the Object explorer go to the Security folder
- In the Security folder expand the Logins folder
- Find the Login in which you log in to the desired server
- Right-click on that Login
- Click on the Properties command from the Right-click window
- The Login Properties window will be opened
- Go to the General tab in the Login Properties window
- And for the Default database choose the master database