none
Cannot create database on my local machine RRS feed

  • Question

  • Hi.

    Thanks in advance.

    I currently have SQL 2008 Server R2 installed on my machine and its' working as expected.  With this via Mgmt Studio, I was unable to create a database on my local machine.  I kept getting permissions errors.  No matter what I did I could not do anything locally.

    To alleviate this I installed SQL Server 2012 Express Mgmt. Studio on my local machine, for the sole purpose of being able to create a local database for testing and learning purposes.  During the install I was not prompted to configure the admin account or any other similar task so I could not set the sa password.  After the install was complete, when I launched 2012 express mgmt studio and selected my local machine as my server name (using Win authentication) and pressed the Connect button, I got:

    "Login failure for user [domain\user].  (Microsoft SQL Server, Error:  18456].  This is the same error I was getting with my 2008 R2 install, under the same circumstances.

    Also, the sample databases did not get installed and I'm not sure why.
    When I ran the install (.exe), I ran it as Administrator.
    I am an Admin on my machine.

    I'm only trying to create a local database for testing and learning purposes, but I am unable to find a way to do this.  Can someone let me know what I'm doing wrong?

    Thanks.

    Logan





    Thursday, April 9, 2015 2:24 PM

Answers

  • It looks like you did not have permissions on the sql.. if you are admin on box... try this..

    start the sql server in single user mode --- add '-m' to the start up parameters in configuration manager and restart the sql service. this puts the sql server in single user mode.

    and then open command prompt-- sqlcmd -s "myserver\myinstance"

    and then type --exec sp_addsrvrolemember 'mydomain\myusername','sysadmin'

    go

    exit

    after this is done .. restart the sql and try connecting


    Hope it Helps!!

    • Marked as answer by LoganTherrion Thursday, April 9, 2015 4:33 PM
    Thursday, April 9, 2015 3:23 PM

All replies

  • Is that means you are not able to login to SSMS at all?

    You tried connecting ssms with this name right .\SQLExpress

    If are not able to login to SSMS with any account then reset SA password using below link:

    https://technet.microsoft.com/en-us/magazine/jj853293.aspx


    • Edited by dave_gona Thursday, April 9, 2015 3:08 PM
    Thursday, April 9, 2015 3:08 PM
  • It looks like you did not have permissions on the sql.. if you are admin on box... try this..

    start the sql server in single user mode --- add '-m' to the start up parameters in configuration manager and restart the sql service. this puts the sql server in single user mode.

    and then open command prompt-- sqlcmd -s "myserver\myinstance"

    and then type --exec sp_addsrvrolemember 'mydomain\myusername','sysadmin'

    go

    exit

    after this is done .. restart the sql and try connecting


    Hope it Helps!!

    • Marked as answer by LoganTherrion Thursday, April 9, 2015 4:33 PM
    Thursday, April 9, 2015 3:23 PM
  • 1) login failure check right, check if your account lock or not.

    2) possible check using sa or try check from another user.

    3) check you can see  check sql agent, disconnet and connect again.

    check and confirm.

    • Proposed as answer by AV111 Thursday, April 9, 2015 3:42 PM
    Thursday, April 9, 2015 3:42 PM
  • Thanks Stan210!

    Starting the SQL server in single user mode solved the problem.  Thanks everyone for all your very quick responses. 

    Your help is greatly appreciated.

    Logan

    Thursday, April 9, 2015 4:33 PM