Solution after Windows 11 fails to install sqlserver2012

uninstall first

Win+R to open and run, enter services.msc to view all services/or My Computer Management to find the service list/task manager to enter the service list, stop all services related to Sql Server, as follows:

Open the control panel - uninstall all related software of sqlserver;

Delete the SQL Server related registry: find

  1. HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager, delete the item "PendingFileRenameOperations" on the right:

  2. Delete the folder containing Microsoft SQL Server under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft 

  3. Delete HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer, if not, forget it 

  4. Delete the folder searching for sqlserver under HKEY_USERS\.DEFAULT\Software\Microsoft\VisualStudio;

  5. Delete the folder searching for sqlserver under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services Delete

  6. Delete the Microsoft SQL Server folder in C:\Program Files

  7. Delete the Microsoft SQL Server folder in C:\Program Files (x86)

  8. If you install sqlserver to another disk, find the corresponding place and delete the Microsoft SQL Server folder inside

Windows11 Disk Check

  1. Startup error: The file 'C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\mastlog.ldf' cannot be used because the sector size used when this file was originally formatted was 4096, and the sector size of the current volume is The extent size is 32768. Please move this file to a volume with a sector size smaller than or equal to the original sector size .

  2. Win+r key to open the cmd command, enter the command; D: represents the disk where sqlserver is installed; fsutil fsinfo sectorinfo D: , check whether these two parameters are 4096, if not, you need to change them;

  3. Solution

1. Format the hard disk and specify the sector size; the best way is to re-partition a disk and install sql; Baidu has tutorials

2. Use the command to forcibly modify the parameter simulation sector size to 4kb.

3. Right-click the administrator to run PowerShell, and enter the command:

New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name   "ForcedPhysicalSectorSizeInBytes" -PropertyType MultiString -Force -Value "* 4095"

4. Continue to enter the command to check whether the change is successful

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name   "ForcedPhysicalSectorSizeInBytes"

5. The last step, don't relax, or you will return to Novice Village.

6. Restart the computer, right-click to run PowerShell in administrator mode after completion, enter the command, and check whether the sector has been changed back;

​​​​​​Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" -Name   "ForcedPhysicalSectorSizeInBytes"

7. Congratulations, sqlserver is finally uninstalled, and the installation environment has been completed. Start to install sqlserver; do not disconnect the network in the middle;

8. After restarting, there is an error installing SQLSERVER2012, and the file or assembly cannot be loaded. Please remove the registry value [HKLM/Software/Microsoft/Fusion!EnableLog] 

 If the above error is reported, please delete the file directly

 The above is the solution to install sql server 2012 under Windows 11, I hope it can help everyone.

Guess you like

Origin blog.csdn.net/Angel_asp/article/details/130421046