Jarvis @ JM.me

Windows MS SQL Fixes

Oct 5 · 8min امیرمحمد

Some fixes around MS SQL

Starting MS SQL

To start Microsoft SQL Server on Windows 11, follow these steps:

Method 1: Using SQL Server Configuration Manager

  1. Open SQL Server Configuration Manager:

    • Press Windows + S and search for SQL Server Configuration Manager.
    • Open it from the search results.
  2. Start the SQL Server Service:

    • In the left-hand panel, click on SQL Server Services.
    • In the right-hand panel, right-click on SQL Server (MSSQLSERVER) or the named instance if you are using a different instance name.
    • Click Start from the context menu.

Method 2: Using Windows Services

  1. Open Services:

    • Press Windows + R, type services.msc, and press Enter.
  2. Start SQL Server Service:

    • Scroll down and look for SQL Server (MSSQLSERVER) or your specific instance name.
    • Right-click on it and select Start.

Method 3: Using Command Prompt (Admin)

  1. Open Command Prompt as Administrator:

    • Press Windows + X and select Windows Terminal (Admin) or Command Prompt (Admin).
  2. Run the Following Command:

    net start MSSQLSERVER

    If you are using a named instance, replace MSSQLSERVER with your instance name:

    net start MSSQL$<InstanceName>

After starting the service, you can connect to the SQL Server using tools like SQL Server Management Studio (SSMS).

ERROR

The "Can’t connect to WMI provider" error in SQL Server often occurs when there is a problem with the WMI (Windows Management Instrumentation) provider or SQL Server’s WMI configuration. This usually happens when you’ve installed or upgraded SQL Server.

Fix the "Can’t connect to WMI provider" Error

Method 1: Rebuild the WMI repository for SQL Server

  1. Open Command Prompt as Administrator:

    • Press Windows + X and choose Command Prompt (Admin) or Windows Terminal (Admin).
  2. Navigate to the SQL Server bin Directory:

    • Run the following command to navigate to the correct folder:
    cd C:\Program Files (x86)\Microsoft SQL Server\<InstanceID>\Shared

    Replace <InstanceID> with your SQL Server version. For example, if you’re using SQL Server 2019, this might be 150.

  3. Run the WMI Fix Utility:

    • Execute this command to fix the WMI configuration:
    mofcomp sqlmgmproviderxpsp2up.mof

    This command recompiles the SQL Server’s WMI provider and fixes the problem.

  4. Restart SQL Server:

    • After running the command, restart the SQL Server service.

Method 2: Repair SQL Server Installation

If the above method doesn’t work, you can try repairing the SQL Server installation:

  1. Go to Control Panel:

    • Press Windows + S and search for Control Panel.
    • Open Control Panel and click Programs and Features.
  2. Find SQL Server:

    • Scroll down, find Microsoft SQL Server (version), right-click, and choose Repair.
  3. Follow the Repair Wizard:

    • Follow the steps in the repair wizard to fix the installation.

After repairing, try to open the SQL Server services or use the SQL Server Configuration Manager again.

Big Note!

For SQL Server 2022 and later, the command to fix WMI provider errors is:

mofcomp "sqlmgmprovider.mof"

Ref

More detailed instructions can be found here.

> Comment on twitter (X)
 
CC BY-NC-SA 4.0  2009-PRESENT © Nuxsco (AMS) This website rewrite several times from those years up to present