-
Notifications
You must be signed in to change notification settings - Fork 375
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connection failed #190
Comments
Hi @brincas , Please provide more details, such as OS, driver (sqlsrv or pdo_sqlsrv), driver version, a repro script. |
http://es-loule.edu.pt:8003/portal/teste.php
|
PDO::ATTR_TIMEOUT, PDO::ATTR_PERSISTENT are not supported attributes. |
without those 2 page takes sometime to load and then: Connectando ao sqlsrv (DSN sqlsrv:Server=INOVAR\INOVAR;Database=InovarAlunos;ConnectionPooling=0): Connection failed to sqlsrv : SQLSTATE[HYT00]: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired Connectando ao sqlsrv2 (DSN sqlsrv:Server=SIGE\MICROIO;ConnectionPooling=0): Connection failed to sqlsrv2 : SQLSTATE[HYT00]: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired |
are you able to connect from command line using sqlcmd?
|
To connect to a named instance on a static port, use Server = servername,port_number |
from the sql command i got this: Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired. |
Are you specifying the port? The sqlcmd command would look like this:
|
yes with or without the port 1433 the same result :( |
@brincas What version of SQL Server are you using? |
to the INOVAR\INOVAR its 2008 R2, i just saw in "tcp/ip dynamic ports" nothing is set, only "Tcp Port" 1433 to the SIGE\MICROIO its 2012 but this is not important cause most likely we not gonna use their services anymore. |
[ODBC Data Sources] [inovar] [sige] DS_Version = 4.2 this is config that exists in /etc/odbc.ini |
@brincas Can you confirm that you installed the ODBC Driver? I don't see it in the .ini file |
@brincas, any updates from your end? |
@brincas closing due to inactivity. Feel free to open if you still have the issue. |
I'm having this issue too on CentOS 7. I get the error PDO details are correct and I can run the example script given and that connects and works fine via the CLI. The example fails with the same error when run via Apache. There are no config differences between PHP CLI and Apache + PHP. Any ideas why this produces different responses? |
I'm having this same issue too on Ubuntu 16. I'm trying to connect to a SQL Server who is outside of Linux Server (It's in a Windows Server), i have a developed an application running on Windows Server with IIS and PHP, with the follow code i get a success a connection. $db = new PDO("sqlsrv:Server=xxx.xxx.xxx.xxx\xxxxxx", $db_username, $db_password); But when try this code on Linux server with Apache2 and PHP7 with pdo_sqlsrv installed i get the same error as the others users: ERROR: SQLSTATE[HYT00]: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired I tryed too:
I hope that together can we fix this issue o figure it out whats going on. |
Also having this same issue and getting the same error when using sqlcmd. any help would be great.. |
@jubairsaidi What version of SQL Server are you using? |
12.0.4487.0 |
Hi @meet-bhagdev i made a port test with nodejs and i seen that port 2382 was opened, so i tried to connect over that port like this: I recived the next message: ERROR: SQLSTATE[08001]: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Client unable to establish connection because an error was encountered during handshakes before login. Common causes include client attempting to connect to an unsupported version of SQL Server, server too busy to accept new connections or a resource limitation (memory or maximum allowed connections) on the server. My SQL Server version: |
figured it out. it was a firewall issue. |
I did disabled the firewall but i'm still getting same error. Even when i try to connect to server, no logged connection on server log. |
I'm having this same issue , sqlcmd -S 192.168.2.9/WINCC -U xxxx Sqlcmd: Error: Microsoft ODBC Driver 13 for SQL Server : Login timeout expired. My SQL Server version: |
I found the solution.On my case, i was attempting to connect to a wrong port. With this query you can know wich port is MSSQL Server listening. So i tried again with the correct port and the connection was successful. Ones again the problem was between chair and keyboard. :) How this help to other. |
Hi @pdrappo |
Hi @Rafabin, i would try: |
@pdrappo great thanks. |
I have the same error but not always, can be with any query and only fails sometimes without a defined pattern, using CentOS7, sqlsrv (not PDO) 4.0.8.0, against and availability group. Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) Oct 28 2016 18:17:30 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2012 R2 Standard 6.3 (Build 9600: ) (Hypervisor) xp_readerrorlog 0, 1, N'Server is listening on' connections strings sqlsrv_connect($host, [ I know that I set LoginTimeout but is not normal take more than 5 seconds. Any suggestions? |
@sirio3mil Could this be a latency issue? Have you experience this when running queries with sqlcmd as well? |
I suspect that is availability group domain name network related error, I change our connection string to the IP instead of URL, I think that it's fixed. |
Hi @meet-bhagdev I'm getting this error from php 7.1 SQLSTATE[HYT00] SQLDriverConnect: 0 [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired if I change connection script below to ip address rather than SAGESERVER\SAGESQL I then get SQLSTATE[28000] SQLDriverConnect: 18456 [unixODBC][Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'web_ad' from iSQL isql -v MSSQLTEST web_ad xxxx Any Help would be great. Kind Regards Chris SQL Server version is 10.0.5512 ODBC.ini [MSSQLTEST] ODBCINST.ini PHP Script `<?php $mssql_server = 'SAGESERVER\SAGESQL'; try{
}; ?>` |
Hi, @meet-bhagdev, finally our network team found the issue, connection between firewall and load balancer go through two different switches, one of them fail. Regards |
@sirio3mil That is awesome news! I will go ahead and close this issue. Feel free to re-open it if you still have issues. |
I started to the same error after upgrading packages my Centos 7 server, previously all worked fine, now I have:
According to yum history last time update wa made on 2017-08-21, so latest packages from that date worked fine. I can't run yum history undo for some reason it shows "Failed to downgrade" for all packages. Is there any way I can find more logs from Sqlcmd or Odbc drivers? |
I had to find out the other portnumber SQL Server was listening on by executing
add a Rule for the Windows Firewall on SQL Server host: - enabling specific Port 49155 (I think this can vary) Then this command succeeded on my Ubuntu machine:
|
I too am encountering this issue with OBDC version 17. This is the configuration I have: php version 7.0.30 installed on a zend engine I have the following drivers all installed: ODBC version 0x0380 When trying to connect to my database using the code below, I get the error mentioned at the end.
This is the error I get:
Can someone please help me figure out what I may be doing wrong? |
Hi @mlaferla |
hello, you can help me to the truth he verified all the possible solutions that have shown but it has not solved the problem. My configuration is as follows. doctrine.yaml: I run php bin / console make: migration: and I get the following error:
|
@ingHainower are you using a named instance? If so, please look at the related issue #470. If you want further help please create a new issue and provide more details by answering the questions in the new issue template. |
hi im having this error
Connection failed to sqlsrv : SQLSTATE[HYT00]: [unixODBC][Microsoft][ODBC Driver 13 for SQL Server]Login timeout expired
The pass is correct as the server address
in main site same config (but with php5.3 and old sql server extention) everything working
but with php7 i get this error
both sites are connecting to the same place
help
The text was updated successfully, but these errors were encountered: