locked
how to create login and password for sql authentication mode? RRS feed

  • Question

  •  how to create login and password for sql authentication mode?

    I forget or did not created login and password at the time of installation.

    I am the administrator.


    DBMS:SQL SERVER 2005\SQLEXPRESS



    thanks,
    bharathi
    Monday, February 2, 2009 7:42 AM

Answers

  •  
    How to: Create a SQL Server Login

    Most Windows users need a SQL Server login to connect to SQL Server. This topic shows how to create a SQL Server login.

    1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.

    2. Right-click the Security folder, point to New, and then click Login.

    3. On the General page, enter the name of a Windows user in the Login name box.

    4. Select Windows Authentication.

    5. Click OK.

    1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.

    2. Right-click the Security folder, point to New, and then click Login.

    3. On the General page, enter a name for the new login in the Login name box.

    4. Select SQL Server Authentication. Windows Authentication is the more secure option.

    5. Enter a password for the login.

    6. Select the password policy options that should be applied to the new login. In general, enforcing password policy is the more secure option.

    7. Click OK.

    1. In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <name of Windows User> FROM WINDOWS; GO

    1. In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <login name> WITH PASSWORD = '<password>' ; GO

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

    Hope it is helpful.

    Dannol


    Mark as Answer if it helps. This posting is provided "AS IS" with no warranties, confers no rights.
    • Proposed as answer by Deepak Rangarajan Monday, February 2, 2009 1:51 PM
    • Marked as answer by bharathi_m Monday, February 2, 2009 3:02 PM
    Monday, February 2, 2009 7:50 AM
    Answerer
  • Hi bhrathi,

    "SQL authentication" is also "windows authentication".  SQL Server has two authentication options - Windows and Mixed Mode (Windows/SQL).

    If you don't yet have SQL Server Management Studio Express (SSMS), you can download it from here.

    Log into your server via SSMS (using Windows Authentication).  In the Object Explorer (left pane), right-click on the server, and select Properties.  On the security page, ensure that "SQL Server and Windows Authentication Mode" is checked.  Expand security, then Logins.  Right-click on "sa", and select "properties".  You can set or reset the password for the sa account on the properties screen.

    You can create additional logins by right-clicking on Logins, and selecting New Login.

    Does this help?
    Aaron Alton | thehobt.blogspot.com
    • Marked as answer by bharathi_m Monday, February 2, 2009 3:03 PM
    Monday, February 2, 2009 7:51 AM
  • Try this,

    CREATE LOGIN [TestForums] WITH PASSWORD=N'MicroSOFT77', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON

    GO

    EXEC sys.sp_addsrvrolemember @loginame = N'TestForums', @rolename = N'sysadmin'


    Rajesh Jonnalagadda http://www.ggktech.com
    Monday, February 2, 2009 7:52 AM
  • Rajesh Jonnalagadda said:

    Try this,

    CREATE LOGIN [sa] WITH PASSWORD=N'Test', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON

    GO

    EXEC sys.sp_addsrvrolemember @loginame = N'sa', @rolename = N'sysadmin'


    Rajesh Jonnalagadda http://www.ggktech.com



    Rajesh,

    The sa login is created automatically - you don't need to create it manually.
    Aaron Alton | thehobt.blogspot.com
    • Marked as answer by bharathi_m Monday, February 2, 2009 3:03 PM
    Monday, February 2, 2009 7:59 AM

All replies

  •  
    How to: Create a SQL Server Login

    Most Windows users need a SQL Server login to connect to SQL Server. This topic shows how to create a SQL Server login.

    1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.

    2. Right-click the Security folder, point to New, and then click Login.

    3. On the General page, enter the name of a Windows user in the Login name box.

    4. Select Windows Authentication.

    5. Click OK.

    1. In SQL Server Management Studio, open Object Explorer and expand the folder of the server instance in which to create the new login.

    2. Right-click the Security folder, point to New, and then click Login.

    3. On the General page, enter a name for the new login in the Login name box.

    4. Select SQL Server Authentication. Windows Authentication is the more secure option.

    5. Enter a password for the login.

    6. Select the password policy options that should be applied to the new login. In general, enforcing password policy is the more secure option.

    7. Click OK.

    1. In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <name of Windows User> FROM WINDOWS; GO

    1. In Query Editor, enter the following Transact-SQL command: CREATE LOGIN <login name> WITH PASSWORD = '<password>' ; GO

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

    Hope it is helpful.

    Dannol


    Mark as Answer if it helps. This posting is provided "AS IS" with no warranties, confers no rights.
    • Proposed as answer by Deepak Rangarajan Monday, February 2, 2009 1:51 PM
    • Marked as answer by bharathi_m Monday, February 2, 2009 3:02 PM
    Monday, February 2, 2009 7:50 AM
    Answerer
  • Hi bhrathi,

    "SQL authentication" is also "windows authentication".  SQL Server has two authentication options - Windows and Mixed Mode (Windows/SQL).

    If you don't yet have SQL Server Management Studio Express (SSMS), you can download it from here.

    Log into your server via SSMS (using Windows Authentication).  In the Object Explorer (left pane), right-click on the server, and select Properties.  On the security page, ensure that "SQL Server and Windows Authentication Mode" is checked.  Expand security, then Logins.  Right-click on "sa", and select "properties".  You can set or reset the password for the sa account on the properties screen.

    You can create additional logins by right-clicking on Logins, and selecting New Login.

    Does this help?
    Aaron Alton | thehobt.blogspot.com
    • Marked as answer by bharathi_m Monday, February 2, 2009 3:03 PM
    Monday, February 2, 2009 7:51 AM
  • Try this,

    CREATE LOGIN [TestForums] WITH PASSWORD=N'MicroSOFT77', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON

    GO

    EXEC sys.sp_addsrvrolemember @loginame = N'TestForums', @rolename = N'sysadmin'


    Rajesh Jonnalagadda http://www.ggktech.com
    Monday, February 2, 2009 7:52 AM
  • Rajesh Jonnalagadda said:

    Try this,

    CREATE LOGIN [sa] WITH PASSWORD=N'Test', DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=ON

    GO

    EXEC sys.sp_addsrvrolemember @loginame = N'sa', @rolename = N'sysadmin'


    Rajesh Jonnalagadda http://www.ggktech.com



    Rajesh,

    The sa login is created automatically - you don't need to create it manually.
    Aaron Alton | thehobt.blogspot.com
    • Marked as answer by bharathi_m Monday, February 2, 2009 3:03 PM
    Monday, February 2, 2009 7:59 AM
  • Aaron,
    I just given "sa" as example now i edited my post please check
    Rajesh Jonnalagadda http://www.ggktech.com
    Monday, February 2, 2009 8:17 AM
  • Sounds good, Rajesh.  Just didn't want anyone to get confused ;-)
    Aaron Alton | thehobt.blogspot.com
    Tuesday, February 3, 2009 1:36 AM