What to do when you forget your SQL Server administrator password
If you forget the SQL Server administrator password, you can use the following methods to deal with it
1. Use any member of the local Administrators group of the SQL Server server computer to log in to the SQL Server server
2. Determine the SQL server that has forgotten the administrator password Server service
can be viewed in the service (services.msc), or use the following Powershell command
Get-Service | ? DisplayName -Like 'SQL Server (*)'
3. Stop the SQL Server service
4. Start the SQL Server service in single-user mode (/m parameter)
Use the parameter /m to start and execute it at the administrator command prompt
net start start mssqlserver /m
5. Use slqcmd Completing Administrator Unlock
Starting SQL Server in single-user mode enables any member of the computer's local Administrators group to connect to the SQL Server instance as a member of the sysadmin fixed server role
6. When completed, stop the SQL Server service and run as Just start SQL Servr and related services in the normal way
Powershell universal script – add the current login account to the sysadmin member of SQL Server
# Script It needs to be executed in Powrshell under the administrator command prompt
# You can enter Powershell under the administrator command prompt through the following command
# Powershell Start- Process Powershell.exe -Verb runas
reportdb’ # 定义要操作的 SQL Server 服务 ServiceName # 停止 SQL Server 服务并以单用户模式启动 net.exe stop Service.Name) net.exe start Service.Name) /m # 当前用户加入 SQL Server 的 sysadmin 成员 Service.Name -Split ‘$’)[1] If( -Not user = [Environment]::UserDomainName + ‘\’ + [Environment]::UserName user] FROM WINDOWS; EXEC sp_addsrvrolemember [ Instance -Q $sql # 以正常方式启动 SQL Server 服务(依赖的服务需要手工检查启动) net.exe stop Service.Name) net.exe start Service.Name)
Additional Instructions
One way you can regain access is to reinstall SQL Server and attach all databases to New instance. This solution is time-consuming and may require restoring the master database from backup to restore the logins. If the backup of the master database is older, it may not contain all the information. If the backup of the master database is newer, it may have the same login as the previous instance; therefore the administrator will still be locked out.
This article explains how to deal with forgetting the SQL Server administrator password. For more related content, please pay attention to the php Chinese website.
Related recommendations:
A brief analysis of the use of concat and group_concat in MySQL
Introduction to MySQL graphical management tools
Related explanation of the basic functions of MySQL stored procedures
The above is the detailed content of What to do when you forget your SQL Server administrator password. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Microsoft SQL Server is a relational database management system launched by Microsoft. It is a comprehensive database platform that uses integrated business intelligence (BI) tools to provide enterprise-level data management. It is easy to use, has good scalability, and has a high degree of integration with related software. High advantages. The SQL Server database engine provides more secure and reliable storage functions for relational data and structured data, allowing users to build and manage highly available and high-performance data applications for business.

Introduction to how to use PDO to connect to a Microsoft SQL Server database: PDO (PHPDataObjects) is a unified interface for accessing databases provided by PHP. It provides many advantages, such as implementing an abstraction layer of the database and making it easy to switch between different database types without modifying a large amount of code. This article will introduce how to use PDO to connect to a Microsoft SQL Server database and provide some related code examples. step

SQLServer or MySQL? The latest research reveals the best database selection. In recent years, with the rapid development of the Internet and big data, database selection has become an important issue faced by enterprises and developers. Among many databases, SQL Server and MySQL, as the two most common and widely used relational databases, are highly controversial. So, between SQLServer and MySQL, which one should you choose? The latest research sheds light on this problem for us. First, let

With the popularity of the Internet, website and application development has become the main business of many companies and individuals. PHP and SQLServer database are two very important tools. PHP is a server-side scripting language that can be used to develop dynamic websites; SQL Server is a relational database management system developed by Microsoft and has a wide range of application scenarios. In this article, we will discuss the development of PHP and SQL Server, as well as their advantages, disadvantages and application methods. First, let's

SQL Server vs. MySQL: Which database is more suitable for high availability architecture? In today's data-driven world, high availability is one of the necessities for building reliable and stable systems. As the core component of data storage and management, the database's high availability is crucial to the business operation of the enterprise. Among the many databases, SQLServer and MySQL are common choices. So in terms of high availability architecture, which database is more suitable? This article will compare the two and give some suggestions.

In web development, the combination of PHP and MySQL is very common. However, in some cases, we need to connect to other types of databases, such as SQL Server. In this article, we will cover five different ways to connect to SQL Server using PHP.

SQLServer and MySQL are currently two very popular relational database management systems (RDBMS). They are both powerful tools for storing and managing large-scale data. However, they have some differences in handling large-scale data. This article will compare SQL Server and MySQL, focusing on their suitability for large-scale data processing. First, let us understand the basic characteristics of SQLServer and MySQL. SQLServer is developed by Microsoft

With the continuous development of the Internet, database selection has become increasingly important. Among the many databases, SQLServer and MySQL are two high-profile options. SQLServer is a relational database management system developed by Microsoft, while MySQL is an open source relational database management system. So how to choose the best database solution between SQLServer and MySQL? First, we can compare these two databases in terms of performance. SQLServer is processing
