Changed of SQL Server name caused the client PC cannot connect to the server - sql

Recently SQL Server was accidentally changed by one of the staff, and this caused the user unable to login to the server via the application. However, even at the later stage, the server name was reverted back to the same name, it was still inaccessible.
Can anyone help?
Already tried to put into the cliconfg settings point the IP and Hostname to the SQL Server but still unable to connect.

Check Server allowed port. or Enable connect Ethernet in server config. After setting restart sql server service and sql browser service

Related

SQL Server Express - Connect from remote machine

I have two Win 7 64 bit machines.
On the first one I have installed SQL Server 2008 R2 Express and have no trouble connecting via Management Studio with Windows Auth and also via SQL Auth with a user I set up on the database.
On the second machine I am trying to connect to the database on machine 1 using Management Studio. I'm trying SQL Auth. I therefore obviously also can't connect to it via connection string in my .NET Code
I can ping the first machine from the second.
Things I have tried include the following:
On the machine the database is installed make sure the firewall is allowing connection on Port 1433
Made sure SQL Server service is running
Made sure SQL Server Browser service is running
Created an exception for sqlbrowser.exe in the firewall
Enabled TCP/IP Protocol through SQL Configuration manager
Allowed Remote connections in SQL Server Management Studio
The error I get is:
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
This is the connection string I use in code
Data Source=xxx.xxx.xxx.xxx\sqlexpress;Initial Catalog=dbName;User Id=myUser;Password=myPassword;
This can be caused by a number of reasons but I'm glad my suggestion about checking firewall ports (rather than just allowing a one-way exception for SQL Browser) led you to the answer: the firewall wasn't allowing the correct port # through.
If i remember correctly SQL Server disables remote connections by default.
Please check whether remote connections are enabled and enable them if not:
RMB on Server in Management Studio Object Explorer -> Properties -> Connections -> Allow remote connections...

Connect ot SQL Server Express 2012 over the internet

I've been trying to configure my sql server express 2012 to recieve connections over the internet without any luck for hours (I'm using Team Foundation Service for nightly builds but it fails when it tries to run unit tests that interact with the sql server).
All I keep getting is this message :
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)
I have tried the following in order to solve this:
Install and run SQL Server Browser
Enable TCP/IP for the sql server instance (using the default SQLEXPRESS)
Enable Port forwarding in my router
Added SQL Server and SQL Server browser apps to the firewall allowed apps list.
Banged my head against the wall.
My sql server is mixed mode, and the username and password are correct (it works when using the local ip address)
I've read every post here regarding this problem but nothing so far..
I'm pretty desperate so any advice will be greatly appreciated!
thanks
Solved it.
Only had to enter my public IP adress without the isntance name.
For example xxx.xxx.xxx.xxx instead of xxx.xxx.xxx.xxx\SQLEXPRESS
I can't believe it's such a stupid mistake ...

Unable to connect to SQL Express "Error: 26-Error Locating Server/Instance Specified)

I am at an loose end with one particular box that is running SQL Server 2008 R2 Express.
Windows Firewall is configured to allow inbound TCP & UDP 1433, 1434.
Windows Firewall is configured to allow outbound TCP & UDP on any port.
No other software AV/FW is currently running.
When I try to connect to xxx.xxx.xxx.xxx\sqlexpress, it times out with the following error:
TITLE: Connect to Server
Cannot connect to xxx.xxx.xxx.xxx\SQLEXPRESS.
ADDITIONAL 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: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server, Error: -1)
I have checked that remote connections are allowed on the server.
I have confirmed TCP/IP is enabled and configured in SQL Server Configuration to allow connections on the external IP to 1433.
I have also used Wireshark from my local machine and I can see requests for 1433 UDP going to the remote server.
But using Wireshark on the remote server shows no inbound connection requests for 1433 UDP or anything from my external IP (with filtering to remote RDP from results).
This makes me think it is a firewall issue.
The server is hosted by an external company who have control over the PIX in front of our server.
I need to troubleshoot this as much as possible myself as the hosting company have no clue what they are doing.
I had a similar problem which was solved by going to the "SQL Server Configuration Manager" and making sure that the "SQL Server Browser" was configured to start automatically and was started.
I came across this solution in the answer of this forum post:
http://social.msdn.microsoft.com/Forums/en-US/sqlexpress/thread/8cdc71eb-6929-4ae8-a5a8-c1f461bd61b4/
I hope this helps somebody out there.
press windows+R open RUN Window
services.msc
find SQL Server(SQLEXPRESS) right click on that and start the service
then check
Go to SQL Server Configuration Manager > SQL Server Services > In Right Side window show all the servers which may stop. If you are using "SQLEXPRESS" then ,
Right click on SQL Server(SQLEXPRESS) and start. After try to connect server... I had same problem but I resolved by these steps.
Here is a simple method to troubleshoot connection issues:
Create an empty file called test.udl using a text editor
Double click the file test.udl, then specify your connection properties
Hit the "Test Connection" button.
I recently encountered the same issue however I am using Windows 10 Technical Preview Build 10041 and SQL Server 2014 (Advanced).
Follow the same advice from above:
In particular, my problem was that I did not enable the TCP/IP in Sql
Server Configuration Manager->SQL Server Network
Configuration->Protocols for SQLEXPRESS.
Once you open it, you have to go to the IP Addresses tab and for me,
changing IPAll to TCP port 1433 and deleting the TCP Dynamic Ports
value worked.
Follow the other steps to make sure 1433 is listening (Use netstat -an
to make sure 0.0.0.0:1433 is LISTENING.), and that you can telnet to
the port from the client machine.
Finally, I second the suggestion to remove the \SQLEXPRESS from the
connection.
AND ----> That last line is important! It looks like to be Windows 10 specific; remove \SQLEXPRESS from your connection string. What was frusting was that SQL Management Studio connects just fine using either connection string (full or short), however Visual Studio only accepted the connection string without the \SQLEXPRESS.
The active firewall on the server might be causing this. You can try to (temporarily) turn it off and see if it resolves the issue.
If it is indeed caused by the firewall, you should allegedly be able to resolve it by adding an inbound rule for TCP port 1433 set to allowed, but I personally haven't been able to connect this way.
I had a Same Problem but i solved by Restarting the browser service in SQL CONFIGURATION MANAGER and removing \SQLEXPRESS from the instance name in the connection window.
It's security all about. Make sure you have double check your firewall (windows and anti virus) in some cases when you disabled av firewall and restart your computer, automatically windows firewall is active and it's still block your application. Hope this is helpful ..
Could you post the connection string you're using that's giving you trouble?
You might need to add the port number to the Data Source value, as omitting it can also produce SQL Error 26.
E.g.: Data Source=ServerHostName\SQLServerInstanceName,1433
If you have done anything but in spite of all couldn't connecting?!!
In my case i have changed connection part splitting port "," instead of this ":"
The corresponding TCP port or pipe name is not specified in the connection string (such as Srv1\SQL2008, 1433).
This issue also confused me a few days, after the IT guy changed some security settings on the SQL Server.
I have an EntityFramework for the Web application and for a desktop application.
After I changed some settings on the SQL Server, the Web application comeback to work, but the desktop still facing issue. But I used the same connection string for both applications, it make no sense one is working but the other doesn't.
Then I searched a lot until I found someone saying here it is needed to add port number 1433 after the $ServerName\$DatabaseInstanceName,1433.
After I added it, the exception became:
System.Data.SqlClient.SqlException: Login failed for user
'domain\name-PC$'
Then I found this link. It says to add Trusted_Connection=False;.
The whole connection string should be like:
data source=XXXXX\SQLSERVER,1433;initial catalog=XXXDB;user id=UserID;password=PWD;Trusted_Connection=False;MultipleActiveResultSets=True;
Hope this answer will help the ones out off Generic exception:
Error: 26-Error Locating Server/Instance Specified
Have you Disabled the VIA setting in the SQL configuration manager? If not, do disable it first (if VIA is enabled, you cannot get connected) and yes TCP must be enabled. Give it a try and it should be working fine.
Make the changes only for that's particular instance name.
Cheers!
I found this url to be very useful:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/2cdcab2e-ea49-4fd5-b2b8-13824ab4619b/help-server-not-listening-on-1433
In particular, my problem was that I did not enable the TCP/IP in Sql Server Configuration Manager->SQL Server Network Configuration->Protocols for SQLEXPRESS.
Once you open it, you have to go to the IP Addresses tab and for me, changing IPAll to TCP port 1433 and deleting the TCP Dynamic Ports value worked.
Follow the other steps to make sure 1433 is listening (Use netstat -an to make sure 0.0.0.0:1433 is LISTENING.), and that you can telnet to the port from the client machine.
Finally, I second the suggestion to remove the \SQLEXPRESS from the connection.
EDIT: I should note I am using SQL Server 2014 Express.
This really Works .. i had verified lot of sites and finally got the answer
This may occurs when the master.mdf or the mastlog.ldf gets corrupt . In order to solve the issue goto the following path
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL , there you will find a folder ” Template Data ” , copy the master.mdf and mastlog.ldf and replace it in
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA folder .
Thats it . Now start the MS SQL service and you are done .
While there can be many reasons for this error - In my case it was pretty simple which I overlooked for a while. I was using server IP address along with instance name for Server as -
<add name="MyDBConnection"
connectionString="Persist Security Info=False;User ID=sa;Password=xxx;Database=MyDB;Server=nn.nn.n.nn\SQLInstance01; Connection Timeout=180" providerName="System.Data.SqlClient"/>
Correct connection string will look something like this (note this one doesn't have SQL Server instance name)
<add name="MyDBConnection"
connectionString="Persist Security Info=False;User ID=sa;Password=xxx;Database=MyDB;Server=nn.nn.n.nn; Connection Timeout=180" providerName="System.Data.SqlClient"/>
HTH.
In my case, I Installed SQL Express 2012 and the problem raise after I reboot my PC. I solved so:
I go to Services -> SQL Server (SQLEXPRESS) and I see that was stopped. I started and It's say an login error.
In properties, Tab Log On, I change it to Local System account , then I can start the SQL service.
Then to test it, I go to SQL Server Management Studio and I connect to .\SQLEXPRESS and it works!
I had a similar problem which was solved by going to the "SQL Server Configuration Manager" and making sure that the "SQL Server Browser" was configured to start automatically and was started.
it works for me
I got a similar problem with sql server , I have tried every thing but does not connect to database engine & it shows error:26.
First check if the database engine is running or not. by going into
configuration manager. start > sql server >sql server configuration
manager. On the right pane you should see the sql server (mss .. )
should be running state with a green indication.
IF the database engine is not running, simply uninstall sql
server / format your system if possible and then download sql
server 2012 and management studio. from
https://www.microsoft.com/en-ca/download/details.aspx?id=29062
Install server first, make sure to add server on installation phase
by clicking add server and then install management studio.
All you need to do is to go to the control panel > Computer Management > Services
and manually start the SQL express or SQL server.
It worked for me.
Good luck.

sql server connection error

I keep getting the following error when I try to register a db server:
TITLE: Connect to Server
Cannot connect to p3swhsql-v14.shr.phx3.secureserver.net.
ADDITIONAL INFORMATION:
An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 3)
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=3&LinkId=20476
BUTTONS:
OK
I googled, but most of the solutions are related to checking stuff on the sql server. It
s a shared server and I don't have access to the machine. I tried to register another db server and I get the same error. I know the connection properties are correct. I am not sure what else I can do. Btw, the windows firewall on my local machine is disabled.
There is a similar thread with some suggestions at: Getting a sql connection error when trying to login.
Other possible issues could be a firewall on the server side that is only allowing connections from a certain IP range. Even if your own firewall is off, that doesn't mean the server's firewall is letting your machine through. Did the server admin open up a hole for your home machine?
If the server isn't set up to receive remote connections and you can't edit the server, I'm not sure that there's much you can do. You can't connect to a remote database if it doesn't want you to, and for good reason.
Many times, you can also be limited to just one IP or range of IPs, so it won't work from multiple locations. Again, this is something to set on the server, so you'd need to check with your provider.
This error was due to the office firewall. If I connect to another VPN, everything works fine. Whilst doing research on google, I came across something perhaps it could be useful to somebody else.Go to the registry editor:
HKEY_Local_Machine > software > Microsoft > MSSQLServer > Client > SuperSocketNetLib . The protocolOrder in my instance was set to start with np tcp and so on. You can modify the order so that tcp :: port 1433 is used before trying to connect via named pipes.'
Check out this link.
It was very helpfull. Just follow few steps and u will get to know the solution
http://techpint.com/programming/error-26-%E2%80%93-error-locating-serverinstance-specified-sql-server

SQL Server does not exist or access denied error

I have an application that runs fine when executed off the server. When clients try to connect, they receive the following error:
Failed to get data.
*Data provider could not be initialized
*SQL Server does not exist, or access denied
on my Office Web Components (MDAC). I am guessing there is some security or server configuration error, but I'm not able to pinpoint it. I am running SQL Server 2005.
*Note - clients can't change their security settings, company policy.
When you try this from a command prompt:
TELNET servername 1433
What happens? If you get a blank screen, then SQL Server is listening and you've got something wrong in your client settings. If you get an "Access denied" or "no response"-type answer, it's most likely either a firewall issue or SQL Server isn't listening, but in either case, it's a server issue.
SQL Server 2005 disables network accessibility by default, you might need to enable it
http://msdn.microsoft.com/en-us/library/ms165647(SQL.90).aspx
Your firewall settings might be preventing connections from your clients. If not, it can be a DNS issue.
Most likely an issue with your firewall not allowing remote connections?
If it's working from the server but clients are having problems, I think the "access denied" part of the error is the key here and it's an authentication problem.
What sort of authentication are you using to authenticate your clients? Is the server using impersonation? If you're running clients and server in an active directory domain, the client application (Office or Internet Explorer for example) might be passing credentials to the server which the server is using to authenticate to the database.
For SQL Server to be contactable from a network machine it requires port 1433 to be open on the server for TCP traffic. Additionally, if you have a named instance you should check the port it is listening on as it may be different to the the default and will probably need to be opened. You will also have to open up port 1434 for UDP to support the SQL Browser Service
firewall issue. diable firewall, run instance again