Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Can not connect to SQL Server for the first time

Author  Topic 

OceansBlue
Starting Member

5 Posts

Posted - 2011-05-20 : 20:54:06
Can not establish a connection. Not too sure why

I had to re image my PC to Win 7

OS Win 7 64bit
SQL Server 2008 R2 Express 64bit

Server Type: Database Engine
Server name: (local)
Authentication: Windows Authentication

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-20 : 21:11:15
What's the error message?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

OceansBlue
Starting Member

5 Posts

Posted - 2011-05-20 : 22:24:38
Cannot connect to (local)

Additional information:

A network-related or instance-specific error occurred while establishing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL server is configured to allow remote connections. (provide: Named pipes, error:40 - Could not open a connection to SQL Server) (Miscrosoft SQL Server, Error:2)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-21 : 16:05:29
Is the SQL Server service started? If not, start it.

Also, did you install a named instance? If so, you'll need (local)\instancename.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

jfarrugia
Yak Posting Veteran

55 Posts

Posted - 2011-05-22 : 04:26:13
Retrieved from sqlmusings

"Things to check:
1. Make sure your database engine is configured to accept remote connections
• Start > All Programs > SQL Server 2005 > Configuration Tools > SQL Server Surface Area Configuration
• Click on Surface Area Configuration for Services and Connections
• Select the instance that is having a problem > Database Engine > Remote Connections
• Enable local and remote connections
• Restart instance

2. Check the SQL Server service account
• If you are not using a domain account as a service account (for example if you are using NETWORK SERVICE), you may want to switch this first before proceeding

3. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings in your ASweb P.NET application
• Usually the format needed to specify the database server is machinename\instancename
• Check your connection string as well

<connectionStrings>

<add name=”SampleConnectionString” connectionString=”Data Source=machinename\instancename;Initial Catalog=AdventureWorks;Integrated Security=SSPI;Min Pool Size=5;Max Pool Size=60;Connect Timeout=30? providerName=”System.Data.SqlClient”/>

</connectionStrings>

4.You may need to create an exception on the firewall for the SQL Server instance and port you are using
• Start > Run > Firewall.cpl
• Click on exceptions tab
• Add the sqlservr.exe (typically located in C:\Program Files (x86)\Microsoft SQL Server\MSSQL.x\MSSQL\Binn), and port (default is 1433)
• Check your connection string as well

5. If you are using a named SQL Server instance, make sure you are using that instance name in your connection strings

6. Check SQLBrowser; check that it is running. You may also need to create an exception in your firewall for SQLBrowser.

7. Check that you have connectivity to the SQL Server. Note what you are using to connect: machine name, domain name or IP address? Use this when checking connectivity. For example if you are using myserver
• Start > Run > cmd
•netstat -ano| findstr 1433
•telnet myserver 1433
•ping -a myserver

Check what ports are IP addresses are being returned.

Alternative:
If you still can’t get any connection, you may want to create a SQL account on the server, a corresponding SQL user on the database in question, and just use this username/password combo in your web application."

Where software development knowledge meets the reader
Go to Top of Page

OceansBlue
Starting Member

5 Posts

Posted - 2011-05-23 : 10:48:37
How can I Start SQL Server service ?

No it is not a named Instance. Generic = SQLEXPRESS


quote:
Originally posted by tkizer

Is the SQL Server service started? If not, start it.

Also, did you install a named instance? If so, you'll need (local)\instancename.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-23 : 10:58:20
Generic = SQLEXPRESS? That sounds like a named instance to me.

(local)\SQLEXPRESS

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

OceansBlue
Starting Member

5 Posts

Posted - 2011-05-23 : 12:38:43
(local)\sqlexpress Worked

Thanks.

But now I remember that I installed SQL Server 2008 before, and I had to name all the service before that installation process.

If you had looked at Sql Server 2008 Step By Step by Mike Hotek, you would know what I am talking about.
http://www.amazon.com/Microsoft%C2%AE-Server%C2%AE-2008-Step-Microsoft/dp/0735626049

Is the R2 different?



quote:
Originally posted by tkizer

Generic = SQLEXPRESS? That sounds like a named instance to me.

(local)\SQLEXPRESS

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-23 : 12:41:22
Yes R2 is different.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

OceansBlue
Starting Member

5 Posts

Posted - 2011-05-23 : 12:55:59
Where Can I on R2 details?
Thanks

quote:
Originally posted by tkizer

Yes R2 is different.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-23 : 13:00:37
If you have the R2 engine installed, then you'll find a SQL Server service for it. Check the services applet in Control Panel/Admin Tools and see what you have installed. You should see SQLEXPRESS, so if you another one in there, then that's likely your R2 instance.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -