SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 connot connect to server error
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  07:07:36  Show Profile  Reply with Quote
hi, the sql server cannot connect to server
I want to connect localy
server name: .
Authentication: windows authentication
i see the configuration manager, the sql server service was stopped, but it fails to start.
please help...
I need it soon
thank you

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  07:10:26  Show Profile  Reply with Quote
Whats the error message?

--
Chandu
Go to Top of Page

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  07:32:54  Show Profile  Reply with Quote
the error is
Cannot connect to ..

===================================

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. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (.Net SqlClient Data Provider)

------------------------------
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

------------------------------
Error Number: 2
Severity: 20
State: 0
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  07:54:38  Show Profile  Reply with Quote
Check this link once
http://blog.sqlauthority.com/2008/08/24/sql-server-fix-error-40-could-not-open-a-connection-to-sql-server-fix-connection-problems-of-sql-server/

EDIT:
http://social.msdn.microsoft.com/Forums/en-US/sqlgetstarted/thread/20635877-0699-424b-843f-63ed0fa030d0/

--
Chandu

Edited by - bandi on 04/16/2013 08:01:35
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  08:00:14  Show Profile  Reply with Quote
Check the error message in the following path and post us:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log

MSSQL10_50.MSSQLSERVER --> your instance name

--
Chandu
Go to Top of Page

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  08:16:01  Show Profile  Reply with Quote
2013-04-15 22:58:05.44 Server Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)
Jun 17 2011 00:54:03
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)

2013-04-15 22:58:05.44 Server (c) Microsoft Corporation.
2013-04-15 22:58:05.44 Server All rights reserved.
2013-04-15 22:58:05.45 Server Server process ID is 4336.
2013-04-15 22:58:05.45 Server System Manufacturer: 'Hewlett-Packard', System Model: 'HP Pavilion g6 Notebook PC'.
2013-04-15 22:58:05.45 Server Authentication mode is MIXED.
2013-04-15 22:58:05.45 Server Logging SQL Server messages in file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'.
2013-04-15 22:58:05.45 Server This instance of SQL Server last reported using a process ID of 664 at 4/15/2013 10:56:42 PM (local) 4/15/2013 7:26:42 PM (UTC). This is an informational message only; no user action is required.
2013-04-15 22:58:05.45 Server Registry startup parameters:
-d C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\master.mdf
-e C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG
-l C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA\mastlog.ldf
2013-04-15 22:58:05.49 Server SQL Server is starting at normal priority base (=7). This is an informational message only. No user action is required.
2013-04-15 22:58:05.49 Server Detected 4 CPUs. This is an informational message; no user action is required.
2013-04-15 22:58:05.60 Server Using dynamic lock allocation. Initial allocation of 2500 Lock blocks and 5000 Lock Owner blocks per node. This is an informational message only. No user action is required.
2013-04-15 22:58:05.65 Server Node configuration: node 0: CPU mask: 0x000000000000000f:0 Active CPU mask: 0x000000000000000f:0. This message provides a description of the NUMA configuration for this computer. This is an informational message only. No user action is required.
2013-04-15 22:58:05.70 spid7s Starting up database 'master'.
the log is here:

2013-04-15 22:58:05.75 spid7s Error: 9003, Severity: 20, State: 1.
2013-04-15 22:58:05.75 spid7s The log scan number (974:264:1) passed to log scan in database 'master' is not valid. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf). If this error occurred during replication, re-create the publication. Otherwise, restore from backup if the problem results in a failure during startup.
2013-04-15 22:58:05.75 spid7s Cannot recover the master database. SQL Server is unable to run. Restore master from a full backup, repair it, or rebuild it. For more information about how to rebuild the master database, see SQL Server Books Online.
I tried all the tips in forums, but they didnt helped. please help.

Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  08:18:23  Show Profile  Reply with Quote
I think master database is corrupted...
Do you have full backup?

you have to rebuild master database..
http://www.sqlservercentral.com/Forums/Topic599479-324-2.aspx#bm1297027

Let us know the progress..

--
Chandu

Edited by - bandi on 04/16/2013 08:27:45
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  08:33:53  Show Profile  Reply with Quote
I had same problem sometime ago...
This is the fix in the case of master database corrupted and have no backup
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=181788

--
Chandu
Go to Top of Page

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  08:35:25  Show Profile  Reply with Quote
I havent back up file, what should I do?
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  08:40:52  Show Profile  Reply with Quote
follow my earlier post (Posted - 04/16/2013 : 08:18:23 )

--
Chandu
Go to Top of Page

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  09:03:59  Show Profile  Reply with Quote
thank you bandi, but when I was write the path at cmd, it shows the system could not find the path specified.
i tyoped the path like this:
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn\sqlservr.exe -c -m -sMSSQLSERVER T-3608
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  09:06:17  Show Profile  Reply with Quote
You have to go to Binn folder in MSSQL and then run above sqlserver.exe .....
MSSQL10_50.MSSQLSERVER --> your instance name

--
Chandu
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  09:09:40  Show Profile  Reply with Quote
There are several typos in your post
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn>sqlservr.exe -c -m -sMSSQLSERVER -T3608
MSSQLSERVER --> your SQL Server name

refer the following link for any clarification:
http://blogs.msdn.com/b/sqlserverfaq/archive/2011/05/11/inf-hey-my-sql-server-service-is-not-starting-what-do-i-do.aspx

Important note:
Check the .mdf and .ldf files in the following location...
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA
copy and paste them to another drive (for future purpose)

--
Chandu

Edited by - bandi on 04/16/2013 09:14:45
Go to Top of Page

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  09:20:39  Show Profile  Reply with Quote
the service name was MSSQLSERVER
but i have the same problem yet.

Edited by - somy on 04/16/2013 09:27:37
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/16/2013 :  09:31:47  Show Profile  Reply with Quote
Start --> Run --> cmd --> cd\ --> cd Progrm files --> cd Microsoft SQL Server --> up to MSSQL --> Dir
Then show us the list of directories which u have?

Hint: Check Here are the steps to start SQL Server from command prompt:- in the above given link to get the sqlservr.exe path



--
Chandu

Edited by - bandi on 04/16/2013 09:33:15
Go to Top of Page

somy
Starting Member

Egypt
12 Posts

Posted - 04/16/2013 :  10:07:02  Show Profile  Reply with Quote
thank you for helping but because I need it for my project I decided to
uninstal the program and instal it again.
i hope I'll not see the problem after installing.
thank uoy very much
Go to Top of Page

bandi
Flowing Fount of Yak Knowledge

India
2218 Posts

Posted - 04/17/2013 :  01:05:37  Show Profile  Reply with Quote
quote:
Originally posted by somy

thank you for helping but because I need it for my project I decided to
uninstal the program and instal it again.
i hope I'll not see the problem after installing.
thank you very much


Will you have backup of other databases(Project's database)?

--
Chandu
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 1.5 seconds. Powered By: Snitz Forums 2000