MonoX support board

Start the conversation, ask questions and share tips and solutions with fellow developers.

Non-registered users can only browse through our support boards. Please register now if you want to post your questions. It takes a second and it is completely free. Alternatively, you can log in without registration using your credentials at major sites such as Google, Microsoft Live, OpenId, Facebook, LinkedIn or Yahoo.

Database install on MS SQL Server 2008 failes  (Mono Support )

Viewed 148642 time(s), 24 post(s) 10/17/2012 12:59:55 PMby JanReilink

Related topics

JanReilink

JanReilink

10/17/2012 12:59:55 PM
Hi,

I'm trying to test-drive MonoX, but it fails to install on a ASP.NET 4.0 shared hosting environment (medium trust). It fails with creating the database on MS SQL Server 2008:

- SQL Server Authentication
- Username/Password filled out
- Database name entered
- Use an empty database selected
- --> Finish

Error:
User does not have permission to alter database 'testingcodeorg', the database does not exist, or the database is not in a state that allows access checks. ALTER DATABASE statement failed. sp_dboption command failed.

note: no SQL user gets dbo rights, but: db_datareader, db_datawriter, db_ddladmin and db_securityadmin

How to overcome this error?

Regards,

Jan Reilink
VEVIDA Services, the Netherlands
This content has not been rated yet. 
66 Reputation 11 Total posts
gstadter

gstadter

10/17/2012 1:18:38 PM
At what hosting service is your DB user not included, by default, in the db_owner role inside of your database?
(I want to stay far, far, far away from that hosting service)

Not trying to be mean, but holy moly... I've been doing this for 17 years and never before heard of shared hosting customers not having their DB user accounts included in db_owner role in THEIR databases.
This content has not been rated yet. 
669 Reputation 67 Total posts
JanReilink

JanReilink

10/17/2012 1:40:05 PM
It's quite common among shared hosting providers. Giving the db_owner role to a DB-user is just not done afaik, but that's a whole other discussion :)

Can I install MonoX without the db_owner role, like Umbraco or DotNetNuke for instance?
This content has not been rated yet. 
66 Reputation 11 Total posts
khorvat

khorvat

10/17/2012 1:44:28 PM
Hi,

in order to install the MonoX you will have to gain certain permissions that are required to execute installation SQL Script. This script will create tables, stored procedures, views etc. that MonoX requires in order function properly.

As Gstadter said, best option would be to have db_owner permissions, as this is the role that you should own for your database.

Let us know if you need more information.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
khorvat

khorvat

10/17/2012 1:53:06 PM
Can you please try to use the following SQL Scripts, they should be placed in the /MonoX/Installer/Sql folder.

Regards
This content has not been rated yet. 
15993 Reputation 2214 Total posts
JanReilink

JanReilink

10/17/2012 2:26:04 PM
Thanks for your reply.

Unfortunately it did not work (after altering the hardcoded "MonoX2" database name in all files). The error message remains the same:
---
User does not have permission to alter database 'testingcodeorg', the database does not exist, or the database is not in a state that allows access checks. ALTER DATABASE statement failed.
---

What "ALTER DATABASE" statement is executed? (I can't find it, or my grep is sloppy)
This content has not been rated yet. 
66 Reputation 11 Total posts
JanReilink

JanReilink

10/17/2012 2:44:59 PM
PS: found a second .zip in the same thread you mentioned; didn't work either.

We're looking into (the security implications of) giving the db_owner role. But imo it would be perfect if the installer could run without this role (only db_datareader, db_datawriter, db_ddladmin and db_securityadmin are recommended by Microsoft)
This content has not been rated yet. 
66 Reputation 11 Total posts
khorvat

khorvat

10/18/2012 9:00:20 AM
I'm not sure that we have ALTER DATABASE anywhere as I couldn't find it either. Is it possible for you to run the SQL Profiler and see / provide us with the exact script that fails so we can review ?

Thanks
This content has not been rated yet. 
15993 Reputation 2214 Total posts
GeorgeBirbilis11

GeorgeBirbilis11

10/19/2012 3:31:57 PM
I had issue with ALTER DATABASE when I tried to install on SQL Server 2012 with some beta scripts you gave me I remember (see http://www.mono-software.com/Mono/Pages/Discussion/dtopic/_ByQzd1JiUmsB6BjATBTyA/MonoX-installer/?dmsgId=_EvC4azjf0yz26BnANVL_w#Post_EvC4azjf0yz26BnANVL_w )

it was:
"2012-06-05 14:09:23Z: User does not have permission to alter database 'MonoX2', the database does not exist, or the database is not in a state that allows access checks. ALTER DATABASE statement failed."

it would be nice if one could see more info from MSSQL in such errors

and this fixed it:
"so I made a new empty db, named MonoX2 (seems somebody hardcoded that name in the scripts or something) and tried again:"

I do remember too that it was asking for db_owner (the datawriter etc. rights weren't enough) - in my case the issue was the hardcoded MonoX2 name (was trying with a MonoX db)
This content has not been rated yet. 
0 Reputation 3 Total posts
khorvat

khorvat

10/19/2012 3:53:36 PM
I think that we have found the issue in the import scripts, so we will try to find a solution to this. Stay tuned.
This content has not been rated yet. 
15993 Reputation 2214 Total posts
1 2 3