How to Configure MSSQL Database in Plesk

Overview

Plesk MSSQL support lets you create and manage Microsoft SQL Server databases directly from the Plesk control panel, without touching SQL Server Management Studio (SSMS) for day-to-day tasks. If you’re running a .NET application, an ASP.NET CMS, or any Windows-based web stack, you’ll almost certainly need this.

Plesk doesn’t ship with SQL Server bundled in — it integrates with an existing SQL Server instance installed on the same machine or accessible over the network. That distinction matters. If you’ve just provisioned a new Windows VPS and you’re wondering why MSSQL options aren’t showing up in Plesk, it’s because SQL Server itself hasn’t been installed or registered yet. That’s the most common source of confusion and it’s not obvious from the Plesk UI.

This article covers the full setup flow: registering a SQL Server instance in Plesk, creating a database and user, setting permissions, and resolving the errors users hit most often after setup.

Prerequisites

  • Plesk Obsidian 18.0 or later (Windows edition) installed and licensed
  • Microsoft SQL Server 2019 or 2022 installed on the server — Express edition works for most small apps
  • Administrator or root-level access to the Plesk panel
  • SQL Server configured to allow SQL Server Authentication mode (Mixed Mode), not Windows Authentication only
  • TCP/IP protocol enabled in SQL Server Configuration Manager
  • Port 1433 open in Windows Firewall if connecting remotely
  • The sa account password, or credentials for another SQL Server login with sysadmin privileges

Step 1: Register the SQL Server Instance in Plesk

Before any subscription can use MSSQL, Plesk needs to know where SQL Server is running. This is a one-time admin task.

  1. Log in to Plesk as Administrator.
  2. Go to Tools & Settings > Database Servers.
  3. Click Add Database Server.
  4. Set Database server type to Microsoft SQL Server.
  5. In the Hostname field, enter localhost if SQL Server is on the same machine. For a named instance (e.g. SQLEXPRESS), use localhostSQLEXPRESS.
  6. Enter port 1433 (default). Named instances often use dynamic ports — check SQL Server Configuration Manager if you’re unsure.
  7. Enter the Administrator login (usually sa) and its password.
  8. Click OK. Plesk will test the connection immediately.

📝 Note: If you’re on a VPS SSD Hosting plan running Windows Server, SQL Server Express is free to install and more than adequate for most applications under 10 GB. Full SQL Server Standard or Enterprise is needed if you exceed Express edition limits.

⚠ Warning: Do not use the sa account as the ongoing application database user. Register it here for Plesk integration, then create a least-privilege user per application in the steps below.

Step 2: Create a New MSSQL Database

  1. In Plesk, navigate to the subscription (domain) where you want the database.
  2. Click Databases in the subscription dashboard.
  3. Click Add Database.
  4. Enter a Database name. Plesk may prefix it with the subscription username automatically — this is normal behaviour and helps avoid naming collisions.
  5. Under Database server, select the MSSQL instance you registered in Step 1.
  6. Click OK.

The database is created immediately. You’ll see it listed under the Databases tab with the server type shown as mssql.

Step 3: Create a Database User

  1. From the Databases list, click the database name you just created.
  2. Click Add User.
  3. Enter a Database user name and a strong password. Passwords must meet SQL Server complexity requirements: at least 8 characters, mixed case, numbers, and a symbol.
  4. Click OK.

Plesk creates a SQL Server login and maps it to the database as a user with db_owner role by default. That’s appropriate for most web applications.

📝 Note: If your application only needs read access (e.g. a reporting front-end), you should manually assign a more restrictive role via SSMS or T-SQL after Plesk creates the user. Plesk doesn’t expose granular role assignment in the UI.

To set a read-only role manually via T-SQL:

USE YourDatabaseName;
ALTER ROLE db_datareader ADD MEMBER YourUserName;
ALTER ROLE db_owner DROP MEMBER YourUserName;

Step 4: Connect Your Application to the Database

Your application needs a connection string. Here’s what a standard ASP.NET connection string looks like using SQL Server Authentication:

<connectionStrings>
  <add name="DefaultConnection"
       connectionString="Server=localhost;Database=YourDatabaseName;User Id=YourUserName;Password=YourPassword;TrustServerCertificate=True;"
       providerName="System.Data.SqlClient" />
</connectionStrings>

For .NET 6+ applications using appsettings.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=YourDatabaseName;User Id=YourUserName;Password=YourPassword;TrustServerCertificate=True;"
  }
}

⚠ Warning: The TrustServerCertificate=True flag is often needed on self-hosted SQL Server instances that don’t have a valid SSL certificate installed. Without it, .NET 4.8+ and .NET 6+ drivers will refuse the connection. Don’t use this flag against external or production databases where you can’t control the certificate chain.

Step 5: Access the Database via phpMyAdmin Alternative (Plesk DB WebAdmin)

Plesk includes a web-based database manager for MSSQL. From the Databases list, click WebAdmin next to your database. This opens a browser-based interface where you can run queries, browse tables, and import/export data — no SSMS installation required.

For bulk imports, use the Import tab to upload a .sql or .bak-derived script file. Large imports over 50 MB should be done via SSMS or the command line to avoid PHP timeout limits in the WebAdmin interface.

To restore from a .bak file via T-SQL (run in SSMS or sqlcmd):

RESTORE DATABASE YourDatabaseName
FROM DISK = 'C:BackupsYourBackupFile.bak'
WITH REPLACE,
     MOVE 'YourDatabaseName' TO 'C:Program FilesMicrosoft SQL ServerMSSQL16.MSSQLSERVERMSSQLDATAYourDatabaseName.mdf',
     MOVE 'YourDatabaseName_log' TO 'C:Program FilesMicrosoft SQL ServerMSSQL16.MSSQLSERVERMSSQLDATAYourDatabaseName_log.ldf';

📝 Note: The MSSQL16 folder name corresponds to SQL Server 2022. SQL Server 2019 uses MSSQL15. Check your actual install path in Windows Explorer before running this.

Common Issues & Troubleshooting

“Cannot connect to database server” when registering in Plesk

This almost always means one of three things: TCP/IP is disabled in SQL Server Configuration Manager, the SQL Server Browser service isn’t running (required for named instances), or Windows Firewall is blocking port 1433. Open SQL Server Configuration Manager, go to SQL Server Network Configuration > Protocols for MSSQLSERVER, and confirm TCP/IP is Enabled. Restart the SQL Server service after enabling it — changes don’t take effect until you do.

“Login failed for user” error in application logs

This usually means SQL Server is running in Windows Authentication Only mode instead of Mixed Mode. In SSMS, right-click the server, go to Properties > Security, and switch to SQL Server and Windows Authentication mode. Then restart the SQL Server service. The sa account is disabled by default in Windows Auth mode, so you’ll need to enable it explicitly:

ALTER LOGIN sa ENABLE;
ALTER LOGIN sa WITH PASSWORD = 'YourStrongPassword!';

MSSQL option not appearing in Plesk’s “Add Database” dropdown

If you don’t see Microsoft SQL Server as a database type option, no MSSQL server has been registered at the admin level. Log in as the Plesk Administrator (not a reseller or subscription user) and complete Step 1 above. Subscription-level users can’t register database servers themselves.

Database import times out or fails via WebAdmin

Plesk’s WebAdmin tool has a 30-second PHP execution limit for database operations. For scripts over a few megabytes, use sqlcmd from the command line instead:

sqlcmd -S localhost -U YourUserName -P YourPassword -d YourDatabaseName -i C:pathtoscript.sql

“The database principal owns a schema” error when dropping a user

This happens when you try to remove a database user who owns the default dbo schema or a custom schema. Transfer schema ownership first:

ALTER AUTHORIZATION ON SCHEMA::dbo TO dbo;
DROP USER YourUserName;

This error is annoyingly common and the SQL Server error message doesn’t make it obvious what you need to fix. Transferring the schema to the built-in dbo principal resolves it cleanly.

FAQ

Frequently Asked Questions

Can I use MSSQL with Plesk on Linux?

No. Plesk’s native MSSQL integration is only available on the Windows edition of Plesk. If you’re on a Linux server, you’d need to run SQL Server for Linux separately and connect to it manually via your application’s connection string — Plesk won’t manage it through the Databases panel.

What's the difference between MSSQL Express and full SQL Server in Plesk?

SQL Server Express is free and works fine for most small-to-medium web apps. The main limits are a 10 GB database size cap per database, no SQL Server Agent (so no scheduled jobs), and capped CPU and memory usage. If your application needs scheduled tasks, larger databases, or high concurrency, you’ll need SQL Server Standard or Developer edition.

How do I back up an MSSQL database in Plesk?

Plesk’s built-in backup tool can include MSSQL databases when you run a full subscription backup. Go to Websites & Domains, click Backup Manager, and ensure the backup scope includes databases. For scheduled or more granular backups, I’d recommend setting up a SQL Server Agent job or using a Maintenance Plan directly in SSMS — Plesk’s backup covers the basics but doesn’t give you point-in-time recovery options.

Can multiple subscriptions share the same MSSQL database server in Plesk?

Yes. Once an MSSQL server is registered at the admin level, all subscriptions on that Plesk server can create databases on it. Each subscription’s databases are isolated by user permissions, but they all live on the same SQL Server instance. For production environments with strict isolation requirements, you’d want separate SQL Server instances per client.

Why is my MSSQL database user showing as 'orphaned' after a restore?

Orphaned users happen when you restore a database from another server — the database user exists but its SQL Server login SID doesn’t match anything on the new server. Fix it by re-mapping the user to an existing login: run ALTER USER [YourUser] WITH LOGIN = [YourLogin]; in the context of that database. This is a very common issue when migrating databases between servers or environments.

SHARE THIS ARTICLE

Need help with your hosting?

Host & Tech provides 24/7 support for all VPS, dedicated, and shared hosting customers.

Scroll to Top