none
Error: "CREATE DATABASE permission denied in database 'master'."

    Question

  • I got error when i attached my web site in IIS 7.5 ...
    Website that didn't connect database is run smoothly ...  
    But website that connected with database is got db permission error like that ...

    CREATE DATABASE permission denied in database 'master'.
    An attempt to attach an auto-named database for file C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\DBYDining.mdf failed. 
    A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. 

    pls help me ... i use .Net Framework 4.0 and Database Server is MS SQL Server 2008 ...

    WithRegards,
    ShweNannThu


    • Moved by Bob BeaucheminMVP Wednesday, August 01, 2012 10:38 PM Moved to the closest relevent available forum. You should also try cross-posting to ASP.NET forums (From:.NET Framework inside SQL Server)
    Wednesday, August 01, 2012 5:08 AM

Answers

  • Hello,

    I was wrong in setting to Application Pool.

    I got it after choosing like that.

    • Start IIS
    • Sites > Default Web Site 
    • Right Click on Default Web Site and then Choose Virtual Directory
    • Give Alias and Select the path which your site located, and then click OK
    • Right click on your site (given the name in Alias) and choose Convert to Application
    • Right Click on Application Pool and Choose Add Application Pool
    • Give Name and Choose Framework Version and then Choose Integrated in Managed Pipeline Mode, and then click OK
    • In Application Pools Pane, Right Click on Application Pools you named and Choose Advanced Setting
    • In Advanced Setting Dialogue Box, Give Local System on Identity in Process Model
    • Return to your Web Site under Default Web Site, Right Click on your Web Site,  Manage Application > Advance Settings ...
    • In this Dialogue Box, General > Application Pool > Choose the Application Pool you gave 
    • And then Return your Web Site, Browse your start up Page in Content View
    • Web Site will run :)

    Thanks and Best Regards,


    ShweNannThu



    Friday, August 03, 2012 5:09 AM

All replies

  • Hello,

    First, you should post this question to a more related forum, this one is for .NET CLR assemblies inside SQL Server.

    As the messages says, check first it the database (file) already exist in your SQL Server installation.

    Next check the ConnectionString you are using, if it's ok (you may post it here so we can have also a look at).


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

    Wednesday, August 01, 2012 5:54 AM
  • Double post:
    http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/4d6a5de9-f9a3-4b89-bd05-03ca98cc5576
    http://social.msdn.microsoft.com/Forums/en-US/sqlnetfx/thread/a8014c4c-245e-4685-8df6-c1c992993edc

    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

    Wednesday, August 01, 2012 7:09 AM
  • Hello,

    As I already wrote:

    As the messages says, check first it the database (file) already exist in your SQL Server installation.

    Next check the ConnectionString you are using, if it's ok (you may post it here so we can have also a look at).


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

    Wednesday, August 01, 2012 7:09 AM
  • Hello,

    I already check it ...

    My database file is already exist in C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\

    and also checked my ConnectionString ... but not okay :(


    ShweNannThu

    Wednesday, August 01, 2012 7:30 AM
  • My database file is already exist in C:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\DATA\

    and also checked my ConnectionString ... but not okay :(

    Is the database (file) attached to SQL Server?

    And how does your connection string look like?


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

    Wednesday, August 01, 2012 9:44 AM
  • Yes ... My database is attached to Database Server ...

    I think I was wrong in setting Application Pool ...

    Now I recheck it ...



    ShweNannThu

    Wednesday, August 01, 2012 10:05 AM
  • And the connection string?

    I guess it contains "AttachDatabasefile" for a user instance, which won't work if the database is already attached.


    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

    Wednesday, August 01, 2012 10:21 AM
  • Hello,

    I was wrong in setting to Application Pool.

    I got it after choosing like that.

    • Start IIS
    • Sites > Default Web Site 
    • Right Click on Default Web Site and then Choose Virtual Directory
    • Give Alias and Select the path which your site located, and then click OK
    • Right click on your site (given the name in Alias) and choose Convert to Application
    • Right Click on Application Pool and Choose Add Application Pool
    • Give Name and Choose Framework Version and then Choose Integrated in Managed Pipeline Mode, and then click OK
    • In Application Pools Pane, Right Click on Application Pools you named and Choose Advanced Setting
    • In Advanced Setting Dialogue Box, Give Local System on Identity in Process Model
    • Return to your Web Site under Default Web Site, Right Click on your Web Site,  Manage Application > Advance Settings ...
    • In this Dialogue Box, General > Application Pool > Choose the Application Pool you gave 
    • And then Return your Web Site, Browse your start up Page in Content View
    • Web Site will run :)

    Thanks and Best Regards,


    ShweNannThu



    Friday, August 03, 2012 5:09 AM