Saturday, February 25, 2012

Could not create new databse

Hello everyone. Well I am just starting out, and I seem to have everything running. One problem I am having though is with MSDE. Right now I am working my way through the Quick Tour of ASP.Net Web Matrix. I am on the section with working with a SQL server and a database. Whenever I try to create a new database in Web Matrix, and I go to SQL server, I try to connnect but it says "Could not create new database." "SQL server does not exist or access denied." "ConnectionOpen (Connect())."

Now in my systray I have MSSQLSERVER running. I tried creating the database using Windows authentication and SQL server authentication. Both give me the same error. Can anyone help me out with this? I am a newbie at this, but slowly learning.

Your help is appreciated.

Thanks in advance.

WesWhen you connect with SQL server authentication, what login are you using?
In order to create a database, the login you are using must have sufficient permissions to do so (typically logged in as sa). If you're planning on connecting via Windows authentication, you will need to log in as sa and then make your windows login a member of the administrators group.|||When I connect using the Windows Authentication it works fine, its just the SQL server that doesn't work. Is there a way I can change permissions with the SQL Server? Sorry I'm new at this but any help is appreciated.

Thanks.

Wes|||Ya lost me. When you connect with Widows authentication, what "works fine"? Creating the database? Just connecting? Have you tried connecting as sa?|||OK sorry i just realized I got completely confused. I can't copnnect with either Windows authentication or ****. How would I try connecting as SA, does that have to do with the password I used at startup, because there was no username I had to enter. I take it this is a permissions problem, because MSSQLSERVER is running in my system tray, so it must just mean its not giving permissions right?

Thanks.

Wes|||Yes, it's all a permissions issue. When you set up SQL server one of the questions you are asked is for a system administrator (sa) password. It defaults to nothing, so if you didn't put anything in there, the sa password is blank. So, log in with the SQL username of sa and the password left blank. You should be able to create a database.|||OK when I set up SQL Server I used MSDE, It never asked me any questions it just installed, and then when I restarted my pc, it came up in my system tray. I did however have to add a line into the setup.ini file to allow me to install it. Would that be the password? Also how do I log into SQL, do I do it somehow in the command prompt?

Thanks.

Wes|||Then it most likely SA has a password that's blank. In Web Matrix, you'll need to specify that you're using a SQL connection and the username is "sa" and the password is "".|||Unfortunatly that didn't work either. Is there anyway I can see what the username and password is?

Wes.|||I don't know, but I'll find out for you on Monday.|||When I installed MSDE, It made me specify the SA password as a commandline argument. I don't know of any way to get SQL to tell you what password a login has. If there were, that would be a pretty big security hole. One thing I've found though is that when installing SQL Server, system administrator logins get created for each person who is an administrator on the box. So what you could try is logging in using windows authorization (assuming you are an admin on the box).

No comments:

Post a Comment