0

I am very new to the database field and I have followed various sources such as Creating new user/login in sql azure and this to create and grant new user access to databases, they were all successful during the creation process but as soon as I tried logging in to the database, I get the following error.

Authentication:14678e5d-f8f5-4b1f-bb19-c67effaf2309[Microsoft.SqlServer.MessageText=Login failed for user 'vitra_public_user'. ,Microsoft.SqlServer.MessageSeverity=14,Microsoft.SqlServer.MessageId=18456]

So here is the procedure and details of how I created and granted the user access, can someone spot any mistakes that I have made pls.

  1. creating a new LOGIN under the master database. CREATE LOGIN vitra_public WITH password='<mY_PasSwOrd_hErE>'

  2. go into the specific(e.g. 'vitra-web') database to create user linking to the login. CREATE USER vitra_public_user FOR LOGIN vitra_public

But as I tried logging onto the vitra-web database on Azure, I got the error so if anyone can spot any mistake that I made will be great!

Thanks

Ken

Community
  • 1
  • 1
ken chan
  • 35
  • 5
  • are you connecting to your database using "vitra_public" or "vitra_public_user" ? you should be connecting using the login, not the user. have you also tried login in this format @ ? – JuneT Dec 17 '14 at 12:20
  • @JuneT, I just tried 'vitra_public' and it logged me in, but I couldnt see any of my tables, is it because the fact that I haven't assigned any role to the login yet?? and it also brings me to the next question, so what did I create the 'vitra_public_user' for if its not used as a login? Also, you mentioned about @, what server is this refering to? so in my case, it would be vitra_public@ Thanks for your help! – ken chan Dec 17 '14 at 14:06
  • from SQL perspective, a login is used to connect/authenticate to the server. A login is then mapped to the corresponding user in the database. a simplistic view will be login grants entry to server, user grants entry to database. You CREATE USER statement simply says "I want you to map this login to this database user". The is the server name in SQL Database. – JuneT Dec 18 '14 at 01:00
  • Thanks @JuneT, I managed too make it work following your advise. cheers – ken chan Dec 18 '14 at 16:12

0 Answers0