Thanks for your time. I am new to SQL Server. I am using 32 bit odbc driver 17 and SQL server version is 2008. Using the same credentials, I am able to connect through SSMS but not through ODBC driver connection settings. I am not sure whats wrong on this one. Your help is highly appreciated.
Microsoft ODBC Driver for SQL Server Version 17.04.0001
Running connectivity tests...
Attempting connection
[Microsoft][ODBC Driver 17 for SQL Server]SSL Provider: The target principal name is incorrect.
[Microsoft][ODBC Driver 17 for SQL Server]Client unable to establish connection
TESTS FAILED!
Strange since you are able to connect through SSMS.
But try to add the server name like this (with default port number): "ServerName,1433" (of course if the port for connection to the server is the default one)
I have seen this few times in the past where you are able to connect to the instance through SSMS without adding port number, and not able to connect with ODBC if the port number is not explicitly given.
Also it is very good idea to double check again all the connection details given such as - Username, Password, Default database to connect to.
Related
Thanks again for answering my question. I have searched thoroughly the forum for possible answers but I could not find any success. I am trying to connect my SQL SERVER database to MATLAB. I have created an ODBC connection but its telling me the following the message :
{Microsoft][ODBC Driver Manager] Invalid String or Buffer Length. I heard that there might be issues with 64b version with some database, so I decided to change the IPALL port to 1433 on SQL configuration, note that here I have only client protocols under SQL NATIVE CLIENT configuration 32b, so i dont have the IPALL section, just TCP/IP with 1433, which is already correct. I am using a windows authentification.
So I decided to use a JDBC to see if it works, I did modified the txt files, classpath.txt and librarypath. Then I configured the JDBC in the matlab but I am getting :
The TCP/IP connection to the host localhost, port 1433 has failed. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall"
I dont know how to make this connection work, could you please help me? I am a rookie.
Note that my database is local, everything is local, my sql server have some tables which i want to get on MATLAB through ODBC or JDBC. I have created ODBC sources. As said earlier, I dont have any kind of SQL server per se in the config, the TCP/IP is only under client protocols under SQL Native Client 11
Hope its clear for you and thanks in advance.
S.
I had the same problem with 64bit version of windows. I tried windows 32b and it works now.
you can also watch this short clip on how to configure ODBC connection:
www.youtube.com/watch?v=DqbEHG2oAHg
Hello guys,
i am unable to connect mysql workbench with windows azure sql database so i can manage the DB from PC without issues.
Is their a way to do it.. ? or is their an option or alternative to achieve my goal ?
Please help me regarding my query ! Thanks a lot :)
UPDATE:
Here is the error code i am getting:
[Window Title]
MySQL Workbench
[Main Instruction]
Cannot Connect to Database Server
[Content]
Your connection attempt failed for user 'username' from your host to server at xxxxxxxxx.database.windows.net:1433:
Lost connection to MySQL server at 'waiting for initial communication packet', system error: 10060
Please:
1 Check that mysql is running on server xxxxxx.database.windows.net
2 Check that mysql is running on port 1433 (note: 3306 is the default, but this can be changed)
3 Check the username has rights to connect to xxxxxx.database.windows.net from your address (mysql rights define what clients can connect to the server and from which machines)
4 Make sure you are both providing a password if needed and using the correct password for xxxxxxx.database.windows.net connecting from the host address you're connecting from
[Close]
Your server is xxxx.database.windows.net, so you are using SQL server, not MySQL server.
MySQL server format is: xxxx.mysql.database.azure.com.
You should use a MySQL server if you want to connect to MySQL Workbench.
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 ...
All,
I am trying to connect SQL Server named instance using Microsoft JDBC Driver as well as jTds.
Both were giving different problems .
Microsoft Driver issue :
Connection URL :
dataSource.setUrl("jdbc:sqlserver://xx.xx.xx.xx;databaseName=DBNAME;instanceName=SQL2005");
instance SQL2005 has failed. Error: java.net.SocketTimeoutException: Receive timed out. Verify the server and instance names, check that no firewall is blocking UDP traffic to port 1434, and for SQL Server 2005 or later verify that the SQL Server Browser Service is running on the host.
jTDS:
Connection url :
DriverManagerDataSource dataSource = new DriverManagerDataSource();
dataSource.setDriverClassName("net.sourceforge.jtds.jdbc.Driver");
dataSource.setUrl("jdbc:jtds:sqlserver://XX.XX.XX.XX:1434/DB_NAME;namedPipe=true;domain=dom");
pipe\sql\query (Logon failure: unknown user name or bad password)
Please give me a good solution to connect MS SQL SERVER NAMED INSTANCES using spring.
Thanks in advance
Based on the error message, and the fact that it is missing from your code, you need to set user name and password somewhere too.
dataSource.setUser("db_username_here");
dataSource.setPassword("db_password_here");
When I am trying to connect to the localhost, there is no problem. But when I am connecting to my server, I am getting this error.
[08S01][MySQL][ODBC 5.1 Driver] Lost connection to MySQL server at ‘reading initial communication packet’, system error: 2
Please tell me how to work around this.
I have tried with MySQL ODBC Drivers, both 3.51 and 5.1 drivers.
An ODBC connection to MySQL cannot be made through HTTP (or PHPMyAdmin).
How are you trying to connect?
Edit: time-out may also be an issue. Change the connect_timeout global variable to 30
seconds (or some other 'long' time) and see whether that helps.