Applicable to:
- Plesk for Windows
Symptoms
-
When importing/exporting a Microsoft SQL Server database dump, applying the settings for a database user or activating/deactivating a domain in Plesk, the operation fails with the message:
PLESK_ERROR: User or role 'db_user' does not exist in this database.
... -
When changing the password of a database user in Plesk, the operation fails with the error message:
PLESK_ERROR: Error: Connection to the database server has failed: Failed to update user permissions for jdoe: SQLSTATE[42000]: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]User or role 'jdoe' does not exist in this database.
-
A website cannot be opened with:
PLESK_INFO: Server Error in '/' Application.
The SELECT permission was denied on the object 'User', database 'db_example', schema 'dbo'.PLESK_INFO: Server Error in '/' Application.
Cannot open database "db_example" requested by the login. The login failed.
Login failed for user 'db_user'.
Cause
The website's database user is not mapped to the website database in SQL Server.
Resolution
- Connect to your Plesk server via RDP.
-
Start SQL Server Management Studio (SSMS) at Windows Start > All Programs > Microsoft SQL Server Tools XX.
Note: If SSMS is not installed, download it from the official Microsoft website and install.
- In SSMS, connect to the database server where the affected database user is located.
-
Expand Security > Logins > right-click on the database user and open its Properties.
- Switch to the User Mapping tab.
-
Find the user's database and check it under the Map column.
-
Click on the database and enable the following role memberships:
- db_datareader
- db_datawriter
- db_ddladmin
- public
- Click OK.
Comments
Please sign in to leave a comment.