connecting SQL Servers (2014) in workgroup in Windows 7 - sql-server

I have a laptop (PC2) and a desktop (PC1) in a workgroup. PC1 is running SQL Server 2014 Developer and PC2 is running SQL Server Express 2014. Using SSMS, I have tried many different ways to connect to PC1 Sql Server, but always get error 18456.1
I'm obviously new to SQL Server administration. The servers on both PCs are configured for both Windows and SQL Server Authentication. SQL Server browser service is running and enabled. The log on ASUS-JHS-CM6850 (PC1, desktop) shows
06/05/2015 14:42:25,Logon,Unknown,Login failed for user
'ASUS-JHS-CM6850\Guest'. Reason: Could not find a login matching the
name provided. [CLIENT: 192.168.1.15] 06/05/2015
14:42:25,Logon,Unknown,Error: 18456 Severity: 14 State: 5.
I'm pretty sure I need to add logins or users to one or both servers, but I've been struggling with this for days now. I also don't know why it's logging in as Guest, nor have I found a way to change that.

Sorry, should have posted as answer. See comment above. Problem solved.

Related

Microsoft SQL Server Login Stuck

I have a Microsoft server 2012 running Microsoft SQL Server 2017 Express database. I am trying to log in through SQL Server Management on a remote machine but the log in loads forever and gives no error.
If I put in the wrong username and password I do get an error that the username and password is wrong and the error shows in the SQL Server log so it does seem to be making some type of connection.
When I connect on the local server it connects right away.
I have TCP enabled in the server configuration.
Does anyone know why this hang might be happening?
Only reason seems to be large database server with too many fragmented databases and may be slow network speed at the moment.

Cannot connect to SQL Server when browser and protocols are already enabled

I've just reimaged a windows 10 box and installed SQL Server 2012 Management tools, client tools and it has its own SQL Server which works fine.
I'm trying to connect SSMS or Odbcad32 to a SQL Server instance on another machine on the same domain and both SSMS and Odbcad32 won't connect.
Odbcad32 gives this error message:
SqlState: '01000'
SQL Server Error:67
Connection Failed:
SqlState: '08001'
SQL Server Error: 17
SQL Server does not exist or access denied
The SQL Server browser is already started. Client protocols are all on for both 32 and 64 bit. i.e. shared memory, TCPIP and named pipes are all enabled, in that order.
I've googled a million threads on this topic and they all seem to find resolution when one of the two above paragraphs are satisfied, but not in this case.
Any other machine can connect to that SQL Server fine.
I can ping it fine.
Changing the SQL Server computer name to the ip address doesn't help, it still won't connect.
The remote server has an instance name of sql2008, which I am obviously including when I connect in the form machinename\sql2008.
Thanks in advance.
Edit: connecting via Windows auth or SQL Server auth is the same. I am logged in to Windows as domain\administrator. UAC is off on this box.

Check client connection to SQL Server 2008 Express [duplicate]

I just installed SQL Server 2008 Express on my Vista SP1 machine. I previously had 2005 on here and used it just fine with the old SQL Server Management Studio Express. I was able to connect with no problems to my PC-NAME\SQLEXPRESS instance (no, PC-NAME is not my computer name ;-).
I uninstalled 2005 and SQL Server Management Studio Express. I then installed SQL Server 2008 Express on my machine and elected to have it install SQL Server Management Studio Basic.
Now, when I try to connect to PC-NAME\SQLEXPRESS (with Windows Authentication, like I always did), I get the following message:
Cannot connect to PC-NAME\SQLEXPRESS.
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: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476
When I installed SQL Server 2008, I had it use SQLEXPRESS as the local instance name. As far as I can tell, through SQL Server Configuration Manager, SQL Server is configured to allow remote connections.
When I went to the help link it mentions, the help page suggests the following:
Make sure that the SQL Server Browser service is started on the server.
Use the SQL Server Surface Area Configuration tool to enable SQL Server to accept remote connections. For more information about the SQL Server Surface Area Configuration Tool, see Surface Area Configuration for Services and Connections.
Well, as far as I can tell, there is no SQL Server Browser service on my system (looked in MMC for one, couldn't find one).
And the SQL Server Surface Area Configuration tool doesn't exist in SQL Server 2008. So good job there with your help documentation, Microsoft ;-).
I'm at a loss for what to do right now. I had a lot of work I was hoping to get done today after upgrading to 2008 (the person I'm working with got it up and running with no problem and told me it would be easy - he's also far better with database stuff that I am). Does anyone have any idea what might be wrong? I'd really appreciate it. If I can't get this working in a few hours, I'm going back to SQL Server 2005 (if that will even work, gah...).
Edit: I have tried turning Windows Firewall off, and that did not help. Also, I noticed that I do not have a "Data" directory under my SQL Server 2008 install directory tree - could I have possibly set something up wrong when I installed it?
Please check the ServerName which you provided. It should match with the below shown Name in the UserName textbox, and that name should followed with \SQLEXPRESS:
Start your Local SQL Server Service
Start SQL Config Manager: Click Start -> Microsoft SQL Server 2008 R2 -> SQL Server
Configuration Manager
Start SQL Services: Set the SQL Server (SQLEXPRESS) and SQL Server Browser services to automatic
start mode. Right-click each service -> Properties -> Go into the Service Tab
This will ensure they start up again if you restart your computer. Please check to ensure the state is "Running" for both services.
Login and authenticate with your Local SQL Server
Now open up SQL Server Management Studio and click "Connect to Object
Explorer" and select Server Name:
[Your PC name]\SQLEXPRESS
Example: 8540P-KL\SQLEXPRESS or (localhost)\SQLEXPRESS
To find your PC name: Right click My Computer -> Properties ->
Computer Name tab
Alternative: Login using windows authentication: Using the user name [Your
Domain]/[Your User Name]
Setup User Account
Create a new Login acct: In SQL Mgmt Studio -> Expand your local Server -> Security -> Right
click on Logins -> New Login
Set Password settings on New User Account: Uncheck Enforce password policy, password expiration and user must
change pw(Since this is local) Default database -> Your Database
Grant roles to New User Account: User Mapping Page -> Map to your db and grant db_owner role Status
Page -> Grant Permission to connect and Enable Login
Setup Access Permissions/Settings for User
Enable all auth modes: Right click your Local Server -> Properties -> Security Tab -> Enable
SQL Server and Windows Authentication Mode
Enable TCP/IP: Open SQL Server Configuration Manager -> SQL Server Network
Configuration -> Protocols for SQLEXPRESS -> Enable TCP/IP
Restart SQL Server Service: You will have to restart the SQL Server(SQLEXPRESS) after enabling TCP/IP
Database Properties File for Spring Project
database.url=jdbc:jtds:sqlserver://[local PC Computer
name];instance=SQLEXPRESS;DatabaseName=[db name];
database.username=[Your user name] database.password=[Your password]
database.driverClassName=net.sourceforge.jtds.jdbc.Driver
If you want to view larger screen shots and better formatting of the answer with more details please view the blog article below:
Setting up a Local Instance of SQL Server 2008 Blog Post:
I used (LocalDB)\MSSQLLocalDB as the server name, I was then able to see all the local databases.
Haha, oh boy, I figured it out. Somehow, someway, I did not install the Database Engine when I installed SQL Server 2008. I have no idea how I missed that, but that's what happened.
I know this question is old, but in case it helps anyone make sure the SQL Server Browser is running in the Services MSC. I installed SQL Server Express 2008 R2 and the SQL Server Browser Service was set to Disabled.
Start->Run->Services.msc
Find "SQL Server Browser"->Right Click->Properties
Set Startup Type to Automatic->Click Apply
Retry your connection.
I've just solved a problem related to this which may help other people.
Initially when loading up MSSMSE it had the server as PC_NAME\SQLEXPRESS and when I tried to connect it gave me Error: 26 - Error Locating Server/Instance Specified, so I went into SQL Server Configuration Manager to check if my SQL Server Browser and SQL Server services were running and set to automatic, only to find that instead of saying SQL Server (SQLEXPRESS) it says SQL Server(MSSQLSERVER).
I then tried connecting to PC-NAME\MSSQLSERVER and this time got SQL Network Interfaces, error: 25 - Connection string is not valid) (MicrosoftSQL Server, Error: 87) The parameter is incorrect so I googled this error and found that somebody had suggested that instead of using PC-NAME\MSSQLSERVER just use PC-NAME as the Server Name at the server connection interface, and this seems to work.
There's a link here http://learningsqlserver.wordpress.com/2011/01/21/what-version-of-sql-server-do-i-have/ which explains that MSSQLSERVER is the default instance and can be connected to by using just your hostname.
I think this may have arisen because I've had SQL Server 2008 installed at some point in the past.
Under Configuration Manager and Network Configuration and Protocols for your instance is TCP/IP Enabled? That could be the problem.
var.connectionstring = "server=localhost; database=dbname; integrated security=yes"
or
var.connectionstring = "server=localhost; database=dbname; login=yourlogin; pwd=yourpass"
For me, I was only able to get it to work by using "." in the server name field; was banging away for awhile trying different combos of the user name and server name. Note that during install of the server (ie this file: SQLEXPR_x64_ENU.exe) i checked default instance which defaults the name to MSSQLSERVER; the above high voted answers might be best used for separate named (ie when you need more than 1) server instances.
both of these videos helped me out:
use dot for server name: https://www.youtube.com/watch?v=DLrxFXXeLFk
general setup: https://www.youtube.com/watch?v=vng0P8Gfx2g
One of the first things that you should check is that the SQL Server (MSSQLSERVER) is started. You can go to the Services Console (services.msc) and look for SQL Server (MSSQLSERVER) to see that it is started. If not, then start the service.
You could also do this through an elevated command prompt by typing net start mssqlserver.
For me it was a windows firewall issue. Allow incoming connections. Opening port didn't work but allow programs did.
Link
Link2

SQL Server Login Error when connecting to server with multiple instances

I have a new dedicated SQL Server with 3 different instances installed.
SQL Server 2008 STANDARD
SQL Server 2008 EXPRESS R2
SQL Server 2012 EXPRESS
I am able to bring up all three in SSMS and can attach databases etc no problems.
I am able to connect to each of the different instances from different remote web sites (as I have defined different ports for each instance).
However, no matter which user I try and connect with its giving me this error.
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'USERNAME_HERE'.
The last 6 hours, I have checked absolutely everything including trying different usernames, simple usernames and passwords, verifying firewalls, changing ports, switching each data base on one at a time etc etc...a long list of things.
So is definitely not a username and password issue and I am stumped now as to what it can possibly be.
Could it be something to do with actual NT permissions?
PLEASE HELP ME!!! I AM GOING INSANE!!!

Install Team Foundation Server with Remote SQL Server Database

I am in the process of evaluating TFS 2010. I am trying to install onto our application server which sits in a domain and runs Windows 2008 R2 Standard.
We already have a SQL Server in place on a separate Windows 2008 box that I want to use - this is in the same domain.
After installing TFS, I am using the Advanced Configuration Wizard to try and complete the setup. There are 3 bits that are reporting errors : "Database" and "Reporting".
When I enter the SQL Server details, TFS gives me this error :
TF255049: A connection cannot be made to the server that is running SQL Server. Verify that you have entered the correct name for the server, including the instance name, that the server you attempting to connect to is online, and that you have required permissions to connect... (it goes on a bit more)
The server I have installed TFS on is a web server that runs several .Net websites - all of which can connect to the SQL Server with no problem.
I have tried IP Address, machine name, instance name - all report the same error.
Has anybody been in this situation before?
EDIT : Strangely if I go to the "Reporting Server" page in the wizard and enter the SQL Server name, it connects correctly in order to get the Report Server URL and Report Manager URL. So it seems this maybe user account related?
Two things spring to mind:
You'll need to make sure the TFS service accounts have permissions on the DB server.
If Windows Firewall is on on the TFS box, switch it off for a minute or two and try again.
If that solves it, turn it back on and open the SQL ports.
HTH

Resources