reconnect default database man studio SQL express (4064 error) - sql-server-express

I have SQL Server 2008 Express and Management Studio installed on my laptop
I get an error:
Cannot open user default database. Login failed
I've been googling for hours trying to resolve this but I'm well out of my depth
I can't log on to master or any other database.
I am sure I have disconnected the default database.
How do I get it back / reconnect it?

Related

Configuring TFS SQL Server Instance connecting Error

I am new to Team Foundation server and when I am configuring TFS for SQL Server, I am getting below error where TFS is not able to connect to the SQL Server instance where as when I connect to SQL Server it is connecting successfully. Both SQL Server and TFS are on the same server machine. Please advise
Error while clicking on Test Link
According to the error info, you need to make sure the TFS service accounts(which you started the TFS Installer) have permissions on the DB server.
Add the account in the list of logins in SQL Server side and retry
the previous operation.
Moreover, if Windows Firewall is on the TFS box, switch it off during the installation and try again. After finish the installation reopen the firewall.
For more details you could take a look at below similar issue:
Errors during TFS 2013 install–and how I worked past them
Workaround Error TF255049: Punching a hole through Windows
Firewall

SQL server & Visual Studio

I need help with SQL server in visual studio. I can't seem to connect my visual studio with internal SQL server. I had created a database with visual studio earlier and it was working fine but now i'm getting an error saying:
The attempt to attach to the database failed with the following
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.
(provider: SQL Network Interfaces, error: 50 - Local Database Runtime
error occurred. Cannot create an automatic instance. See the Windows
Application event log for error details.
I have tried to create a new database file in a new project but then i get the error:
A network related or instance specific error occurred while
establishing a connection. The server was not found or was not
accessible. (Provider:Named Pipes Provider, error:40- could not open a
connection to SQL server.
I have tried different things but can't seem to get the hang of the problem. I reinstalled visual studio too but that didn't work either. what can i do to get rid of this error and get my database back online?
If you are running Visual Studio on your local machine, you have not any problem with firewalls and enabling of TCP/IP.
Try this four solutions may fix your problem:
SQL Server Express LocalDB add-on, get it from this link.
Make sure that your SQL service is running.
Use SQL Server Authentication.
Make sure you have typed .\sqlexpress in Server name in Add Connection window. You should use a backslash \ as the separator, not a forward slash.

SQL server Login Fail for user 'ROMANCH9326/romanch'

I installed SQL server 2012 developer addition.
My windows is working on Parallel Access installed on MAC.
When I tried opening SQL server, It initiated a call to connect to server. And when I clicked on connect it gave me error.
I've never installed SQL server 2012 in my personal PC. WHen I was installing I chose Windows authentication mode and user ROMANCH9326 came out automatically.
Please help me, I'm clueless about this problem.
TITLE: Connect to Server
Cannot connect to ROMANCH9326.
ADDITIONAL INFORMATION:
Login failed for user 'ROMANCH9326\romanch'. (Microsoft SQL Server, Error: 18456)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&EvtSrc=MSSQLServer&EvtID=18456&LinkId=20476
On Start > Search type "sql configuration"
Open SQL Configuration Manager
SQL Server Network Configuration >Protocols for [SQLINSTANCENAME]
Check if Named Pipes is enabled, enable it if not.
Restart your SQL Server Instance.
Well This is a pretty silly solution but when I tried repair function on SQL server it said that my Database Engine libraries were not installed properly somehow.
So I reinstalled the software and now it worked just fine. I was able to log in.
Thanks :)

Cannot login to sql server 2008 R2 after rebooting server

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

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.