none
Windows 7 CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262)

    Question

  • Hi

    I have migrated to a new computer using Windows 7, 6 gig memory, I7 chip (old machine had xp) and have installed Visual Studio 2008 and  SQL Server 2008 R2. 

    I get CREATE DATABASE permission denied in database 'master'. (Microsoft SQL Server, Error: 262) when I try to create a new database. 

    Other posts (example:http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/28fee0ed-c7e2-40df-8f79-f513c9848f09/) work for Vista but I cannot find how to grant permissions.  Run as administrator (vista fix) does not work.

    I have admin privaleges on my machine.  There are no other accounts.   

    What do I need to do to update privaleges?

    Thanks and have a nice day.

     

     

    Monday, August 09, 2010 7:32 PM

Answers

  • Click Start --> All Programs --> SQL Server Management Studio Express

    (Right Click --> Run as administrator)

    Then Click "Yes" in Dialog box

    Now you can Create the Database...

    It really works..

    Saturday, August 28, 2010 7:35 AM
  • During the setup of SQL 2008 you must have specified (at least one) system administrator for the instance of SQL Server, or SA account if you are using mixed mode authentication

     you need to use credentials for that account to gain access to your SQL Server,

    The last option is to start SQL server in a singler user mode, in that case anyone who is local administrator on that computer can connect to SQL Server as a member of sysadmin fixed server role. 

    Monday, August 09, 2010 8:17 PM
  • yeah. if you don't have sa password and you have not added you as sysadmin then as Chirag metioned, single use mode is the option to add yourself as sysadmin to SQL

    Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out

    Start the instance of SQL Server in single-user mode by using either the -m or -f options. Any member of the computer's local Administrators group can then connect to the instance of SQL Server as a member of the sysadmin fixed server role.

    http://msdn.microsoft.com/en-us/library/dd207004.aspx


    Balmukund Lakhani | Please mark solved if I've answered your question
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Monday, August 09, 2010 8:31 PM

All replies

  • OK so a few things have changed with sql 2008 that is affecting you.  Before in 2005 and < the administrators group was assigned serveradmin in the sql server.  Now that is not the case, so you can be an admin on the system but you will not have that access in the sql server.  What you need to do is log in as sa or the admin account that you created and add yourself as a new login with the serveradmin role...then you should be fine.

     

    Jared

    Monday, August 09, 2010 7:56 PM
  • During the setup of SQL 2008 you must have specified (at least one) system administrator for the instance of SQL Server, or SA account if you are using mixed mode authentication

     you need to use credentials for that account to gain access to your SQL Server,

    The last option is to start SQL server in a singler user mode, in that case anyone who is local administrator on that computer can connect to SQL Server as a member of sysadmin fixed server role. 

    Monday, August 09, 2010 8:17 PM
  • yeah. if you don't have sa password and you have not added you as sysadmin then as Chirag metioned, single use mode is the option to add yourself as sysadmin to SQL

    Troubleshooting: Connecting to SQL Server When System Administrators Are Locked Out

    Start the instance of SQL Server in single-user mode by using either the -m or -f options. Any member of the computer's local Administrators group can then connect to the instance of SQL Server as a member of the sysadmin fixed server role.

    http://msdn.microsoft.com/en-us/library/dd207004.aspx


    Balmukund Lakhani | Please mark solved if I've answered your question
    --------------------------------------------------------------------------------
    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------------------------------------------------------------------
    My Blog: http://blogs.msdn.com/blakhani
    Team Blog: http://blogs.msdn.com/sqlserverfaq
    Monday, August 09, 2010 8:31 PM
  • Hi

    First, since I do not know SA or password (I have the only admin account), I tried the process outlined by Jared.  Perhaps, I am missing something.  I created a new account but you only get a choice between admin and user.  I did not find anywhere you can change admin rights.

    Second, I tried the single user approach.  The start up parameters look like -dc:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\master.mdf;-ec:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\Log\ERRORLOG;-lc:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\mastlog.ldf

    I added -f; to the beginning of the string, rebooted and tried to log into SSMS.  It complained stating that since this was single-user mode and only one administrator can connect at this time (SQL error 18461).

    I also tried -m; but had similar results.

    btw http://msdn.microsoft.com/en-us/library/dd207004.aspx does not work.

    What am I missing?

    Thanks for any help.  Have a nice day.

     

    Monday, August 09, 2010 11:25 PM
  • Make sure you stop SQL agent service, before you put SQL server service in Single user mode else you can error saying only one user can be connected.

    correct link should be

    http://msdn.microsoft.com/en-us/library/dd207004.aspx

     Here is another blog post that you can also use to gain initial aaccess to your SQL server..

    http://blogs.msdn.com/b/raulga/archive/2007/07/12/disaster-recovery-what-to-do-when-the-sa-account-password-is-lost-in-sql-server-2005.aspx

    Tuesday, August 10, 2010 12:52 AM
  • Make sure you also stop the reporting services if you have deployed one having the database server as its data source. It is about who acquires the only one connection available – it can be SQL Agent  , reporting services or any other application services that access the database server so stop all these and make sure you are the only one connecting to the SQL server.


    Thanks, Leks
    Wednesday, August 11, 2010 4:05 AM
  • Click Start --> All Programs --> SQL Server Management Studio Express

    (Right Click --> Run as administrator)

    Then Click "Yes" in Dialog box

    Now you can Create the Database...

    It really works..

    Saturday, August 28, 2010 7:35 AM
  • Really helpfull

    Thanks a lot!!!!

    Sunday, October 24, 2010 1:03 AM
  • I didn't work for me..still get permissions denied.
    Dennis in Longview
    Saturday, December 11, 2010 11:50 AM
  • Thanks this really works
    Monday, January 24, 2011 8:39 AM
  • Worked great! Thanks....

    Heather

    Sunday, February 27, 2011 7:55 PM
  • tnx a lot
    Friday, March 11, 2011 6:34 AM
  • Thanks sir ..it is working ...thank you sir
    Monday, March 21, 2011 7:42 PM
  • hanks it works

     

    Tuesday, October 25, 2011 10:43 AM
  • Hi,

     

    Install the SQL Instance in a drive other than the system drive.

    Suppose you have windows installed in C:\ then install SQL Server instance in other Drive like D:\ or so.

    By default in Win 7 you cannot create file in System Drive without Admin login(Run as Administrator) .

     

     


    Regards, Yeou Sunn Liu MCTS, MCITP.
    Tuesday, October 25, 2011 1:22 PM
  • Hy

    I run a aplication of microsoft SQL server security and I could make a administrator user, and all OK.

     

    Monday, January 02, 2012 2:30 AM
  • The best answer I have read.

    Most clear with no ununderstandable technical words and walkthroughs.

    Thank you so much.

    :)

    To Mohammed Adnan T

    I would have given 5 votes but its not possible.

    God bless you

    • Edited by Heer91 Thursday, March 15, 2012 4:48 PM
    Thursday, March 15, 2012 4:47 PM
  • hi..

    m also doing the same thing like Run as Administrator and connect with Server Name (.\SQLEXPRESS) And Authentication (Windows Authentication)

    But i cant create dataBase in it 

    Thanks waiting for reply ....

    Wednesday, March 28, 2012 11:09 AM
  • Simple and solved my problem.
    Wednesday, October 31, 2012 4:11 PM
  • ya this one helped me!! after following lot of stuffs this one really worked... thanks a lot

    Tuesday, December 17, 2013 1:09 PM
  • Não funciona

    Friday, January 10, 2014 4:00 PM
  • I have found realy a very helpfull post ....... Thanks
    Monday, July 07, 2014 6:22 AM