Cannot create MSSQL database user
Error: Unable to perform an operation on the database server: User does not have permission to perform this action.
The following output is in
2015-07-28T21:49:13+01:00 DEBUG (7) [panel]: 0, script = mssqlmng, version = 1.0, args=--add-user --server=203.0.113.2\\MSSQLSERVER2008 --login=dbadmin01 --password=******* --database=fab ricsAlyn --new-user-login=odin_1, stdin=, status=FAILED [28-Jul-2015 21:49:13 Europe/London] PleskUtilException: Remote execution failed with code 1. stdout: User does not have permission to perform this action.
Incorrect login name under db owner properties in MSSQL Management Studio > Databases > db_name -> Security > Users > dbo > Properties .
The user set there should be the one the DB server was registered with. In this example it should be 'dbadmin01'.
- Create backup of the database new user should be created for.
Find the username the DB server was registered with (execute on management node):
# plesk db # mysql> select admin_login from DatabaseServers where host = "203.0.113.2\\MSSQLSERVER2008"; +-------------+ | admin_login | +-------------+ | dbadmin01 | +-------------+ 1 row in set (0.00 sec)
NOTE: The username can also be found in the error output in
/usr/local/psa/admin/logs/panel.log- see snippet unser "Symptoms" paragraph.
- Open SQL Management studio and connect to affected MSSQL server.
In the SQL management studio interface click "New Query" (
Ctrl+N) and execute the following code:
use [testdatabase]; alter authorization on database::"testdatabase" to dbadmin01;
, where 'testdatabase' is the name of the database the user should be added to.