EF Core - Can't login to sql server - entity-framework-core

Been working with a .Net Core app and have been successfully connecting to sql server 2008 sp3 in our qa environment for a while, just tried deploying it to our production environment and am getting this error:
System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: TCP Provider, error: 0 - Unable to write data to the transport connection: Unknown error 10054.)
This is specifically happening in a .Net Core app running in a docker container. Does anyone know what could be the issue? I have seen threads encouraging upgrading sql server to service pack 3, we have done that. Also made sure the TLS settings on the server were correct.

Related

Drupal website mysql error Google Cloud SQL

Today I got a problem with a drupal website connected to a SQL database in Google Cloud SQL (error 502 in my browser).
Accessing the SQL logs I got this entry thousands of times:
2018-10-02 11:49:00.434 ECT
2018-10-02T16:49:00.434633Z 8291808 [Note] Aborted connection 8291808 to db: 'drupal' user: 'root' host: '35.224.213.131' (Got an error reading communication packets)
screen capture log GOOGLE CLOUD SQL
I still could connect from my web server to the SQL server via command line but for some reason I kept getting the same error when I openned the site.
I finally restarted the SQL server and it worked again.
Have any of you encountered this problem?
As you can see over at https://cloud.google.com/sql/docs/mysql/diagnose-issues the message "Aborted connection" usually means that your application is not terminating connections properly, or that you had a network issue.

Can't connect to SQL Azure from EF, but can from SSMS

We have an Azure SQL server running which we use for our Azure Web App. The Web App can connect without a problem. We're trying to remotely update the database with the latest EF migrations via a C# console application.
However we get the following exception.
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)
We tried connecting from the same PC with SSMS and we got in without any problems. And yes, before anyone asks we whitelisted the IP in Azure, else we wouldn't even had access via SSMS. We also tried with and without "tcp:" in the connectionstring.
This is the connectionstring we use in the Web and Console Application:
Server=tcp:{servername}.database.windows.net;Database={dbname};user id = {userid};password = {password};MultipleActiveResultSets=True;
In SSMS we just use {servername}.database.windows.net and use the credentials.
Thanks in advance.
We haven't been able to solve this issue. We instead chose to go with ReadyRoll, which suits us fine.
Azure SQL requires secured connection. You have to add the following to your connection string:
Trusted_Connection=False;Encrypt=True;

SQL Server 2008 R2 ODBC Error: SQL state HTY00

My application server (say 192.168.100.1) and database server (say 192.168.100.2) both are on the same domain. I'm trying to create an ODBC connection from the application server to a SQL Server database on the database server, but at the time of login it generates this error:
Microsoft SQL Server Login
Connection failed:
SQL State: 'HYT00'
SQL Sever Error: 0
[Microsoft][ODBC SQL Server Driver]Login timeout expired
I've checked all configuration for SQL Server and tried possible solutions without resolving this issue.
Important:
A DSN can be successfully created from my own PC but when attempting this server to server as described above, ODBC is facing this problem.
OK, I have got the solution. Sometimes, if SQL Server can't be found on network by its name while creating DSN in windows, the logging in takes time more than usual which tells ODBC manager that Database Server we are looking for is not responding or responding too late.
Solution.
Instead of selecting server from the list while making dsn, use 'server-ip\SQLExpress'.
e.g 192.168.100.2\SQLExpress.
Thats All.

Unable to connect to second generation from SDK on OS X

I am unable to connect to a second generation Cloud SQL database from my OS/X SDK environment using PHP. I get a 1045 "Access denied for user 'user'#'ip address' (using password: YES)" error. I am using SSL for the direct IP connections.
My setup works fine for first generation Cloud SQL databases and it also works from MySQL Workbench.
I am migrating from a first to a second generation database and running tests. The only thing that changes is IP address and the referenced SSL files. From the PHP program the connection string looks like this for both generation 1 and generation 2 connections when using the SDK:
mysql:host=<IP_ADDRESS>:3306;dbname=<DATABASE>
Although the proxy hangs or crashes when attempting to connect it does report a valid connection when testing the connection from MySQL Workbench. When I attempt the actual connection, though, it either hangs after "New connection for..." message or crashes with a fatal error: unexpected signal during runtime execution after issuing the "New connection for..." message.

connection verification failed for data source - Coldfusion Server Administration

I have just installed ColdFusion 10 and am trying to connect to MySql Server 5.1, but it is showing the error below:
Connection verification failed for data source: cfartgallery2
java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer
JDBC Driver]Error establishing socket. Unknown host: MySQL Server The
root cause was that: java.sql.SQLNonTransientConnectionException:
[Macromedia][SQLServer JDBC Driver]Error establishing socket. Unknown
host: MySQL Server
Finally after 2 days I solved my own problem of getting the above error. It was due to a missing ODBC connector.
Steps for resolving:
First download and install the ODBC connector of respective version as of your MYSQL server version.
Rhen install vcredist_x64 it is required for sql connectivity.
Then install any SQL Server to create the database and start connecting to it with the datasource you have created in tour CF Administrator.
Hope you can solve your problem with my instructions , if not then please post your queries below.