Login login Issues after SQL server-Server migration

Source: Internet
Author: User

1. After the server migration, overwriting the original system database to the new server, with the current Windows account unable to sign in, there are several methods:

(1) Add a new account on the original machine and give the administrator permissions, and then migrate to the new machine;

(2) login in single-user mode to create a new login:

1) After the migration is complete, stop the SQL service;

2) Run cmd, enter: ' net start mssqlserver/m ' (default instance)

3) If it is a named instance: ' net start instance name/M '

4) Connect to SQL, using: sqlcmd-e-s<servername>

5) Create the corresponding login and give administrator privileges

For example:

Create login test with password = ' Test '

Go

EXEC master. sp_addsrvrolemember @loginame =n ' test ', @rolename =n ' sysadmin '

Go

Login login Issues after SQL server-Server migration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.