开发者

What is the default username and password of my SQL Server Express?

It installed automatically with Visual Studio 2010 Ultimate. I didn't create any users for 开发者_StackOverflow中文版the server or ANYTHING.

I'm using:

string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Trusted_Connection=yes;";

I get error that authentication failed. So the server is being found, but my credentials are wrong. What would the default login and password be?

Edit: Still not working! :(

Here's my connection string:

string connectionString = @"Server=.\SQLEXPRESS;Database=SportsStore;Integrated Security=SSPI;";

And the error message:

Cannot open database "SportsStore" requested by the login. The login failed. Login failed for user 'ToshibaLaptop\Sergio'.


If you are using SQL Server authentication you could try the username sa and blank password but I am not sure whether this is by default. Integrated Windows authentication should work, so you should be able to connect with your Windows account:

string conn = "Data Source=.\SQLExpress;Initial Catalog=mydb;Integrated Security=SSPI;";


You probably should not connect using Sql Server Authentication.

Log in as an Administrator on the box, connect using Integrated Windows Authentication, and you should be a system admin.


The error message indicates that SQL Server can't open the database. I think you're successfully authenticating, but having a problem connecting to the database. Is the database available?

You can do a test by changing the database to master in your connection string. If that succeeds, then you're problem is related to the database. I understand that you may get other errors, but the test is to confirm that you can login to SQL Server.


For me SQL Server (SQLEXPRESS) service was disabled so it was throwing the error. After enabling the service SSMS is working fine

  1. Goto Run command and type services.msc and click on OK button
  2. Services window will open. Check the status of SQL Server (SQLEXPRESS) service
  3. If the service is not running, then start the service

Now try logging in again in the SSMS.


In SQL 2008 if you use the defaults there won't be a SQL Server user only Windows Authentication will be enabled - and it will only work for the user that installed the application would have access via their Active Directory authentication.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜