title: Cannot open database "master" on SQL Azure
body: <p>TITLE: Connect to Server</p>
  
  <p>Cannot connect to tcp:ohimryXusa.database.windows.net,1433.</p>
  
  <p>ADDITIONAL INFORMATION:</p>
  
  <p>Hello,</p>
  
  <p>I have a SQL Azure database. This database has a username / login that I want to use to access it. When I try to connect to the database by SQL Server Database Management Studio, I receive an error that says:</p>
  
  <pre><code>Cannot open database "master" requested by the login. The login failed.
  Login failed for user 'mydbusername'.
  This session has been assigned a tracing ID of '00000000-0000-0000-0000-000000000000'.  Provide this tracing ID to customer support when you need assistance. (Microsoft SQL Server, Error: 4060)
  </code></pre>
  
  <p>I have other logins that I can successfully connect to the database with. I tried executing the following on my database, to ensure there was a user:</p>
  
  <pre><code>CREATE USER mydbusername
  </code></pre>
  
  <p>I receive an error that says:</p>
  
  <pre><code>Msg 15023, Level 16, State 1, Line 1
  User, group, or role 'mydbusername' already exists in the current database
  </code></pre>
  
  <p>I verified the user existed by logging into the master database. Once there, I ran:
  SELECT * FROM sys.sql_logins;</p>
  
  <p>I wanted to ensure that 'mydbusername' had access on the database. So I logged in, with a more priveleged account, into my database and ran:</p>
  
  <pre><code>EXEC sp_addrolemember 'db_datareader', 'mydbusername'
  EXEC sp_addrolemember 'db_datawriter', 'mydbusername'
  EXEC sp_addrolemember 'db_owner', 'mydbusername'
  </code></pre>
  
  <p>The message said: Command(s) completed successfully.</p>
  
  <p>At this point, we know a) There is a user with the name 'mydbusername'. b) There is a login with the name 'mydbusername'. c) We know that 'mydbusername' has 'db_datareader', 'db_datawriter', and 'db_owner' rights to the database. </p>
  
  <p>I tried logging in via the management screen over the web. I was able to successfully login and execute queries. However, when I try to login via SQL Server Management Studio, I receive the message above. I am using </p>
  
  <p>mydbusername@ohimryXusa for the "Login" field. I've verified that the password is correct. I also verified the Server Name is correct. What am I doing wrong? I really need this because I'm getting the error from my code. Thank you!</p>