Cannot login to sql server 2008 R2 after rebooting server - windows-server-2008

I am using Windows-server-2008 with Microsoft SQL Server 2008.
And there are a lot of questions about this, but nothing on the internet solved it.
The problem is that i can't connect to the my SQL Server 2008 R2 after rebooting my server.
I placed some new memory in my server, and after rebooting my client/server application didn't work anymore because it cannot reach the database.
So i tried to get in SQL Server Management Studio (SSMS), and tried to loggin with Administrator and another user but both do not work.
When i logg in the following message is displayed:
Cannot connect to (local)
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)
(Microsoft SQL Server, Error: 2)
I Tried a lot of different things like:
Rebooting server
Try to start the server manually from Sql Server Configuration Manager
Named Pipes - Enabled
TCP/IP - Enabled
Tried to create an new system user or database user as described in the following article: Click Here
Can somebody please help me? I am really confused because i need to get this online. Otherwise i have to reinstall the database server but i do not have a back-up. (is there some folder with a back-up of the settings/tables/columns are stored and can be imported from reinstall?

I was having the exact same problem. net start mssqlserver was giving me the blurb about a failed login attempt. The problem was that I had recently changed the password for the administrator account, and the new password didn't get updated in services.
Here's how I fixed it:
First locate SQL Server from the list here:
Right click and select properties, and navigate to the Log On tab:
Then I typed the new password, and like magic I was able to start SQL Server right through the services manager.
I also did this for any other processes which were marked as "stopped" even though Startup Type was marked as "automatic" (namely, SQL Server Agent).

Is it a named instance or default? Also, is this a local instance? (I see the "(local)" but just wanted to make sure.)

Start the sql server services from services.msc and try to connect

Related

Connecting to local server in SQL Server Management Studio

I have tried EVERY suggestion I have found so far in SE and nothing works. Let me explain what is going on.
I am a PHP developer and I am making a transition to ASP. So I am developing a website locally and I need a database going, also locally. But like I said, I can't add the NORTHWND database because I don't have the server up and running. I read through the tutorials and I seen to be missing a piece of every puzzle.
I have SQL Server 2008 running.
These guys Add Database say to attach the database via VS12. I have no such option to "Attach"
These guys here Connect to your server say to connect to the SQL server but I can't connect. When I try, I get an error that says:
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)
I also noticed there was a localdb with username LOTUSMS. I don't remember ever making a username for anything here. And I can't remove it or make one up. (Windows Authentication)
And then these guys Turn on your Server Service say the Server must be up and running and to log into the SQL server Configuration Manager and ensure the SQL services are running. Well, they are not. It says "the remote procedure call failed" and there is no other options to restart or edit or anything
So as you can see, I know my problems, but I can't find the solution to them. Anyone? I am not sure as to what logs or extra evidence you may need, so before I go adding unnecessary text and pics here, I'll leave it open and produce the evidence as requested.
Thanks in advance

Cannot connect to SQL server - client side issue

I might be the million'th person posting about this, but others' solutions haven't helped me. I have a database on Microsoft SQL Azure. I an trying to connect to it using the Visual Studio 2010's "Connect to Database" Tool.
From my Windows 7 machine, I can connect to it very easily. But from my Windows Server 2008R2 machine i am getting the classic error -
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)
All the posts around the web seem to be focussing on the problems on the server side, no one cares if the client goes rogue. :(
Thanks for the replies.
I have seen similar problems with VS2010 DB Tool and Windows Server so I would not suggest try using SSMS 2008 R2 (must be R2). Once you have download SSMS 2008 R2 and configured properly to work on Windows Server it sure will work. In most of the case you really need to open SSMS settings to get it workon on Windows Server.
Next a few points to check:
Verify that the telnet is working from your Windows Server Machine:
c:>telnet _your_sqlazure_database_name.database.windows.net 1433
Disable your real time security and the try again
Finally following the link to keep applying settings in your Windows Server and SSMS which are applicable and I am sure it will work:
http://www.mssqltips.com/sqlservertip/2340/resolving-could-not-open-a-connection-to-sql-server-errors/
One issue is that you need to connect via tcp, not named pipes (per your error message).
Are both servers behind the same firewall (e.g. the same external IP address)? The SQL Azure firewall needs to be configured to allow access from remote IP addresses.

SQL Server 2008 R2 First Time Login

I've just started work on a new computer in which I had to download all the software fresh.
I've just download a copy of SQL Server 2008 R2, and I'm trying to connect to SQL Server Management Studio without success. I vaguely remember last time I installed this, it asked me to choose between windows, or sql server authentication, however this didn't happen for this installation.
If I try to login via Windows Authentication (where the username and password fields are greyed out, localhost as server name) it gives the following error:
"A Network-related or instance
specific error occured 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) (Microsoft
SQL Server, Error: 2)"
I have checked everything in SQL Server Configuration Manager, and everything bar VIA is enabled.
If I try SQL Server Authentication, It asks me for a username and password which I definiately have not set yet. Also, under SQL Server Services in configuration manager, there is nothing there.
Any help would be appreciated :)
Thanks
PS: I don't know if it's worth mentioning but I am running Windows 7 as a virtual machine on a Mac.
Are you sure you have the correct instance name? If it was SQL Server 2008 R2 Express Edition then the default instance name is .\SQLEXPRESS.
Also if your using sql authentication to connect try running sql management studio as admin, if you are a limited user your identity might not be mapped to an account in sql server yet but i believe the Administrators user group is.
You need to check if your services are running.
Please type
net start mssqlserver
in your command prompt. Then try to login.
Ended up reinstalling completely and doing a fresh install from a fresh download. When I did this I was brought through the steps of selecting the default instance, and selecting authentication modes.
Working fine now :)
After checking tons of sites looking for an answer to this question, I think I have a simple solution.
Open the sql Server Configuration
Click on the sql server services node
Right Click on Sql server
Click Start.
I have been screwing around with this forever, and this simple method actually worked.

Cannot connect to local SQL Server with Management Studio

I'm having an issue with SQL Server, I have 2005 installed on my desktop as well as having SQL Server Management Studio installed..
I've checked and can see "SQL Server (SQLEXPRESS)" started in services.
I've tried to connect to "Local" and "SQLEXPRESS" but both fail to connect.
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)
Anything else I need to do to connect to it??
UPDATE
I seem to be getting a little further along now. Ive managed to connect to my server with SQL Server Management (FYI .\SQLEXPRESS did the trick) but now im having a issue with my connection string in my web.config
Ive im going to connect to this local sql server using windows authentication how do i need to structure it??
Something like this?
<add name="BensBoxing" connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=BritBoxing_Alpha;Integrated Security=False;User Instance=True" providerName="System.Data.SqlClient"/>
This produces a error about
Login failed for user ''.
Check the sql log in the LOG directory of your instance - see if anything is going on there. You'll need to stop the service to open the log - or restart and you can read the old one - named with .1 on the end.
With the error you're getting, you need to enable TCP/IP or Named pipes for named connections. Shared memory connection should work, but you seem to not be using that. Are you trying to connect through SSMS?
In my log I see entries like this...
Server local connection provider is ready to accept connection on [\\.\pipe\mssql$sqlexpress\sql\query ]
As the comments said, .\SQLEXPRESS should work. Also worstationName\SQLEXPRESS will work.
Same as matt said. The "SQL Server(SQLEXPRESS)" was stopped. Enabled it by opening Control Panel > Administrative Tools > Services, right-clicking on the "SQL Server(SQLEXPRESS)" service and selecting "Start" from the available options.
Could connect fine after that.
I was having this problem on a Windows 7 (64 bit) after a power outage. The SQLEXPRESS service was not started even though is status was set to 'Automatic' and the mahine had been rebooted several times. Had to start the service manually.
Try to see, if the service "SQL Server (MSSQLSERVER)" it's started, this solved my problem.
Open Sql server 2014 Configuration Manager.
Click Sql server services and start the sql server service if it is stopped
Then click Check SQL server Network Configuration for TCP/IP Enabled
then restart the sql server management studio (SSMS)
and connect your local database engine

SQL Server 2005 Express - could not open a connection

I installed Microsoft SQL Server 2005 Express edition on my Vista Ultimate computer. However, when it opens I enter my computer name / SQLEXPRESS. When I click the Connect button, it gives me an error message.
Under the configuration tools I cannot find the SQL Server Surface Area Configuration. It only has SQL Server Error and Usage Reporting.
The error message I receive when I click the Connect button is:
A network related or instance specific error occurred while establsihing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that the SQL server is confugured to allow remote connection (provider: Named Pipes Provider, error 40- Could not open a connection to SQL Server) (Microsoft SQL Server : error 67)
From your question, as you'd written, it appears the slash is incorrect. Try:
.\SQLEXPRESS
Also ensure that your SQL Server services are started. Run services.msc and find SQL Server(SQLExpress).
Another thing to check for is the account that the SQL Express service is running under. I think it defaults to network service, but I typically run it under Local System (or if you're feeling ambitious, make a service account for it). This has taken care of a handful of permission issues I've had with SQL Express in the past.