Skip to content

Knowledgebase

Connecting a Plesk application to Microsoft SQL Server

plesk, development

Connect a Plesk-hosted application to Microsoft SQL Server using the database server and authentication method assigned for that service. SQL Server connection settings differ from MySQL settings, and an available SQL Server option depends on the installed server, licensing and hosting plan.

Check access and requirements

Obtain the server hostname or instance endpoint, database name, supported authentication method and required encryption settings. Create a dedicated application database user with appropriate permissions. Keep credentials in protected application configuration rather than a public file or repository.

01 Connect a Plesk application to Microsoft SQL Server

  1. Open the Plesk database entry and confirm its engine and server. Record the exact database and user names; do not assume every database uses localhost.
  2. Configure the application supported SQL Server driver or provider. Use the intended hostname and port or instance syntax from the service configuration.
  3. Set the authentication method deliberately. SQL authentication uses an assigned SQL credential, while Windows integrated authentication depends on the actual application identity and server trust arrangement.
  4. Enable the required encrypted connection with a server certificate trusted by the application host and matching the hostname. Do not make certificate-trust bypasses a permanent production setting.
  5. Test from the application environment with a harmless query, then a controlled application operation requiring its normal permissions. Avoid using an administrator or sa credential as the routine application login.

02 Example: confirm the database and execution identity

Through an authorized diagnostic using the application's actual SQL Server connection, run:

SQL example
SELECT DB_NAME() AS database_name,
       USER_NAME() AS database_user;

This reads the current database and database-user context without changing tables. Compare them with the database and identity assigned to the application. An administrator connection in a separate management tool can return different values and does not prove that the application uses the right credentials.

A successful result establishes a connection and its context, not every permission the application needs or the complete TLS configuration. Continue with one controlled normal application action and verify the encrypted connection settings separately. Keep names and diagnostic output private, and remove any temporary web diagnostic after testing.

How do I test the SQL Server application connection?

Confirm successful reads and intended writes, correct database selection and no unnecessary access to other databases. Review application and SQL Server logs for authentication or TLS errors. Test again after an application-pool recycle so hidden interactive-session credentials are not masking the setup.

Resolve setup problems

For timeouts, investigate network reachability, listening endpoint and scoped firewall access. For login failures, inspect authentication mode, database mapping and user permissions. For certificate errors, fix trust and hostname consistency. Do not open SQL Server to every internet address or grant sysadmin privileges to bypass a configuration issue.

Was this answer helpful?

Need a little more help?

Our support team can help you find the next step.

Contact support