简体   繁体   中英

How to connect to SQL Server 2008

I have a desktop, and a Laptop. The Desktop has Windows 7 64-bit and the Laptop has Vista Ultimate 32-bit. On both machines I have SQL Server 2008 Standard installed. On the laptop, I open SQL Management Studio and try to connect to the SQL Server on the desktop. It times out.

With SQL Server Config Manager I Enabled TCP/IP and Named Pipes for the client protocols.

In SQL Management Studio, I right clicked on the Database Engine, went to properties, and allowed remote connections. I also created a sql server login named "testuser" and a password. I then added that user as a login for my database and made them the database owner.

I could not figure out how to allow connection to my db throw the windows firewall, so I turned it off.

What am I missing? I made the same changes on my laptop, and I can connect from the Desktop to the Laptop in Management Studio?

Do you have a checklist? Thanks.

UPDATE: I turned off antivirus. Ran NetStat -a and the listener is listening.

If your login attempt takes about 30 seconds to timeout, then it's some kind of network connectivity problem (or SQL isn't listening properly). A permissions problem would come back after a few seconds, so the long wait says it's connection-related.

If you run "NETSTAT -a" on the server, so you see SQL Server listening on port 1433? If not, then maybe the SQL TCP Listener isn't configured properly on the server - there should be events in the Windows Event log to this effect when the SQL Service starts up.

Please edit your question with the results and we can go from there.

Try using Telnet to see if the laptop can see the desktop via port 1433.

Open a command prompt on the laptop and enter:

telnet DesktopNameOrIPAddress 1433

Press Enter, and you should either see a connection failed error, or a blank screen. If you get the blank screen, the connection was established. Press CTRL-] to break out of it, then type "quit" and enter to quit.

If the connection failed, attempt to resolve the general network issue with port 1433 before bothering to use the SQL Server tools.

If you have any other anti-virus software running, it may also have a firewall built in. I know that McAfee does, for instance. Check for that.

You've probably already thought of this, but have you checked that the server is configured to allow Mixed Mode Authentication? I have not had access to 2008, but I seem to remember that at least one of the previous versions was configured to disallow sql logins by default.

I assume you already did what you have to do on the OS level. Or maybe tried to link the server to see if you can actually traverse your network. Let me suggest a quick test. Check if you can actually test connectivity by creating a Universal Data Link. In case you don't know how to do this, create a new text file in your desktop (or anywhere) and change the .txt file extension to .udl; then just open it. See if your other server is "viewable" over the network (Don't forget to change the Provider to OLE DB Provider for SQL Server).

Is the SQL Browser Service running on the server you are trying to access? (By default this is disabled, and you'll need that to access SQL Server remotely)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM