Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unexpected error message from aspnet_regsql

I am trying to use the aspnet___regsql utility to install all the membership tables in a database on my local SQL Express 2008 instance. I can connect without problems in Management Studio, but when I try to list the databases in the aspnet_regsql interface i get an error message saying:

Failed to query a list of database names from the SQL Server.
Invalid object name 'sysdatabases'

What am I doing wrong? How do I fix this?

(Please tell me there's a smoother way than reinstalling the thing... :P)

like image 511
Tomas Aschan Avatar asked Feb 02 '09 21:02

Tomas Aschan


2 Answers

I have solved the problem by bypassing the graphic interface and performing the same action directly in the command prompt, with flags specifying all options. They should look like this:

Connect using SQL Authentication

C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -U myUserID -P myPassword

Connect using Windows Authentication

C:\>Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regsql.exe -S myHostingServer -A all -d myDatabase -E

The difference is at the end of the lines, where SQL Auth. has -U myUsername -P myPassword while Windows Auth. has -E (which flags for Trusted Connection).

like image 96
Tomas Aschan Avatar answered Nov 15 '22 11:11

Tomas Aschan


If you want to use the graphical interface, you need to make sure the user you are logged in as has the default db in SQL set to 'master' so it can connect directly to the sysdatabases table.

like image 36
JRC Avatar answered Nov 15 '22 12:11

JRC