Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello all
I am working from a server database currently. I made a copy of this database and now it is on sql server localhost.
I been trying to connect my application to the localhost database so it will not be using the live database connection anymore


I have tried many different methods here are some examples that i have been trying,
But so far every try the connection fails at login / username.

SQL
servername: 'localhost', seems to work fine

here is my error
- Additional information: Database TRANSIT on server localhost is not accessible. Details: Login failed for user 'WIN-LV74O1VFEK6\Administrator

I have tried many different combinations for username–
SQL
‘Root’
‘Administrator’
‘WIN-LV74O1VFEK6\Administrator’
‘WIN-LV74O1VFEK6’
‘’
‘dbo’
‘username’
‘user’

just to name a few
Posted
Updated 28-Oct-15 9:45am
v3
Comments
ZurdoDev 28-Oct-15 15:25pm    
The error is very clear. You are trying to login with Administrator on the local machine but that account does not have permissions to SQL.
TheBigBearNow 28-Oct-15 15:34pm    
when i change the login/username to any combination i do not have the right username.
How do i fix the issue? by giving admin permission to SQL ?
phil.o 28-Oct-15 15:36pm    
Not clear whether it is MS SQL or MySQL. Please tag your question unambiguously.
And how did you copy the database? Are you 100% sure the original database contains credentials for the new one?
TheBigBearNow 28-Oct-15 15:41pm    
I am using Sql Server 2012.
I used a .bak file to made a copy of the database. I imported it to the localhost.
phil.o 28-Oct-15 15:48pm    
And can you connect to the new instance with SQL Management Studio?
Did you setup 'sa' credentials upon SQL Server installation on target host?

1 solution

Here are a couple of links to gain a better understanding of the MS SQL Server login configuration:
MSDN - SQL Server 2012 - Create Login[^]
MSDN - ALTER LOGIN (Transact-SQL)[^]

Other sources are available on the subject, which appear on the first page of any decent search engine, in particular YouTube videos, if you like this medium.

Courage :)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900