Managing MSSQL Databases in Plesk Print

  • 0

Overview

Microsoft SQL Server (MSSQL) databases are available on your Windows hosting account. This guide covers creating, managing, and connecting to databases through Plesk.

Creating a Database

  1. Log in to Plesk
  2. Go to Websites & Domains
  3. Click Databases
  4. Click Add Database
  5. Enter a Database name
  6. Select Microsoft SQL Server as the type
  7. Under "Create a database user", enter:
    • Database user name
    • Password (use a strong password)
  8. Click OK

Managing Database Users

Add User to Existing Database:

  1. Go to Databases
  2. Click User Accounts
  3. Click Add Database User
  4. Select the database and enter credentials
  5. Click OK

Change User Password:

  1. Go to DatabasesUser Accounts
  2. Click on the username
  3. Enter new password
  4. Click OK

Connection String

Use this format to connect from your application:

Server=localhost;Database=YOUR_DATABASE_NAME;User Id=YOUR_USERNAME;Password=YOUR_PASSWORD;TrustServerCertificate=True;

Example in appsettings.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "Server=localhost;Database=mydb;User Id=myuser;Password=mypassword;TrustServerCertificate=True;"
  }
}

Accessing phpMyAdmin-like Tool

Plesk does not include SQL Server Management Studio, but you can:

  1. Go to Databases
  2. Click on your database name
  3. Use Import to run SQL files
  4. Use Export to backup

Importing Data

Import SQL File:

  1. Go to Databases
  2. Click on your database
  3. Click Import
  4. Upload your .sql file
  5. Click OK

Import from Backup:

Contact support for restoring from .bak files as this requires server-level access.

Exporting/Backing Up

Export Database:

  1. Go to Databases
  2. Click on your database
  3. Click Export
  4. Download the SQL dump file

Tip: Regularly export your database for backup purposes.

Database Size Limits

  • Check your hosting plan for database size limits
  • Monitor database size in Plesk → Databases
  • Contact support if you need increased limits

Troubleshooting Connections

"Login failed for user"

  • Verify username is correct
  • Check password (case-sensitive)
  • Ensure user is assigned to the database

"Cannot open database"

  • Verify database name is spelled correctly
  • Check database exists in Plesk

"A network-related or instance-specific error"

  • Use localhost or . as server name
  • Do not use your domain name for database server

SSL/Certificate Errors

  • Add TrustServerCertificate=True; to connection string

Best Practices

  • Regular backups: Export your database weekly at minimum
  • Strong passwords: Use complex passwords for database users
  • Separate users: Create different users for different applications
  • Minimal permissions: Only grant necessary permissions

Was this answer helpful?

« Back