Connect ColdFusion to SQL Server database instance - sql-server-2008

I am trying to connect to a SQL server (2008) database instance in ColdFusion 9 but there is no where to put an instance name in the CF administrator. I can get in with .net using a connection string like so:
Server=myServerName\myInstanceName;Database=myDataBase;User Id=myUsername;
Password=myPassword;
There is a place to enter a connection string in ColdFusion but I don't seem to be able to connect to the right instance (it seems to connect to the default instance). Is there a way to connect ColdFusion to a SQL Server database instance in the administrator?

If you are NOT using ColdFusion's sandbox security then you can specify the instance name in the server field of the datasource definition in the ColdFusion administrator. As you mentioned, you would just specify myServerName\myInstanceName. But...
If you are using ColdFusion's sandbox security then that will not work. I had this same issue when I upgraded to ColdFusion 9 and never did find a resolution. I entered a bug at Adobe for it: ColdFusion 9.0.1 Bug 84928 It has since been closed as "Deferred" with the reason "Not Enough Time".
I found that the connection issue arose when using ColdFusion's sandbox security. Disable it and the datasource will work with the instance name specified per above. Enable it and that same connection will fail.
In order to get around the bug you need to specify the database server only (without the instance name) in the server name field and specify the assigned port number for the named instance in the port number field. See the bug for full details.

Simply enter the Server with a \ and the name of the instance

Related

Connection CLOUD-SQL to Google-Data-Studio, what is wrong?

I'm trying to establish a connection between Cloud SQL and Data Studio. I've already tried to make a connection through the MySQL connector with a MySQL db and it failed because I think the Router did not allow the connection.
Then I transferred the db on the cloud but I have the same error!!! Which is:
ID errore: f73c5f49
I already opened Cloud-SQL to all the Data Studio IP addresses, I've created users with "%" and given them all the privileges, I created instance, db and user in CLOUD-SQL (MySQL, 2nd generation).
What else can I try? Could it still be a Router problem?I have to do that for work but it keeps saying that connector parameters are wrong.
PLEASE HELP <3 THANKS A LOT
A common error is to write the instance name instead of the "instance connection name".
You can find the "Instance Connection Name" in the instance page, in the overview section, and normally the format is something like:
[PROJECT_ID]:[region]:[NAME_SQL_INSTANCE]
I also had a similar connection problem with MySql 8.0 but changing to 5.7 fixed it.

MySql.Data.MySqlClient.MySqlException using ServiceStack ORMLite

I am working with ServiceStack evaluating the ORMLite provider with MySql for use on a.NET Core 1.1 project. I am running into a curious issue I am not sure what the problem is and looking for some guidance on how to troubleshoot this further or possible fixes.
I am running the .Net Core app in a standard docker container and MySql in the standard MySql container. I have been able to successfully run MySQL and connect with the workbench tool.
What I cannot do is get the executing code of the web application to successfully connect to the MySQL container. I have tried various combinations. Those where the IP Address or hostname were wrong I received a meaningful error saying the host was unknown.
But under scenarios where server name or IP address values that are used that are appropriate for the MySQL container, I receive a generic MySQLException error. The username and password are correct. I have even used the root account to ensure that there aren't any potential security hangups.
Here is a code snippet of where I am attempting to connect. This setup was working well using a local SQL db file, there is just something I am missing with either the configuration of Docker or MySQL that I haven't been able to isolate.
const string connectionString = "Server=3400f112c973:3306;Database=ServiceDB;Uid=root;Pwd=my-secret-pw;";
container.Register<IDbConnectionFactory>(
new OrmLiteConnectionFactory(connectionString, MySqlDialect.Provider ));
using (var db = container.Resolve<IDbConnectionFactory>().Open())
{
if (db.CreateTableIfNotExists<TypeExample>())
{
//Add seed data
}
}
I have figured out my scenario.
In the MySQL Connection string, if you are using a non-standard port, you need to use the port parameter to specify the different port and omit the port entirely if using the standard port.
My issue was I was always using "Server=servername:port;" which is an incorrect format and should have been "Server=servername;Port=port;" in the cases where I was using a nonstandard port number, otherwise Port= can be omitted.

Unable to connect to any of the specified MySQL hosts in NHibernate, MySql

One of the client is reporting this issue happening in our application. NHibernate throws Unable to connect to any of the specified MySQL hosts in the middle of the app running, so it is not a mistake in the configuration. It happens randomly, but always when the transaction is opened.
I saw this:
NHibernate, MySQL, Windows Server 2003 -- connection problems
But the server in my case is Windows 2008. And app opens only single connection simultaneously. MySQL version is 5.5.28. Server is on the remove machine
Unfortunately the app requires the HW I do not have, and I cannot reproduce it locally.
Any ideas or directions I need to dig in?
Try connecting using the full directory name, e.g. instead of Server=SRV use
Server=SRV.yournetwork.com
It might be that is has trouble resolving the server name.

SQL Server 2008 Connection Error "No process is on the other end of the pipe"

Let me begin by saying, I am aware of this thread and others around the web that seek to trouble shoot this issue.
The solutions posted there do not apply to my issue. I have spent 5 hours trying to resolve this before deciding to ask the question.
The problem:
When I attempt to log into SSMS (or connect from a java application) using SQL Authentication I get this error:
A connection was successfully established with the server, but then an
error occurred during the login process. (provider: Shared Memory
Provider, error: 0 - No process is on the other end of the pipe.)
(Microsoft SQL Server, Error: 233)
Although it does work, it is not an option for me to use integreated authentication.
The database I am attempting to connect to is on the same machine as my SSMS instance. There is no network, this is a stand-alone system.
NAMED PIPES is ENABLED in my configuration, I HAVE rebooted since, TCP IP is a higher priority than named pipes in my configuration.
I have even gone as far as to uninstall SQL Server and reinstall it, to no avail.
The details of my SQL Server instance are as follows:
Microsoft SQL Server Management Studio - 10.0.2531.0
Microsoft Analysis Services Client Tools - 10.0.1600.22
Microsoft Data Access Components (MDAC) - 6.1.7601.17514
Microsoft MSXML - 3.0 5.0 6.0
Microsoft Internet Explorer - 9.0.8112.16421
Microsoft .NET Framework - 2.0.50727.5466
Operating System - 6.1.7601
Configuration details are as follows:
http://i45.tinypic.com/vxdz7c.png
http://i45.tinypic.com/vxdz7c.jpg
I connect from java using this code.
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl = "jdbc:sqlserver://localhost;database=AdventureWorks;integratedSecurity=false;User=JIMBO; Password=JIMBO;";
Connection con = DriverManager.getConnection(connectionUrl);
But please remember, this error also occurs when I atttempt to log in to SSMS directly.
Thanks in advance.
-Jim
To force TCP/IP being used replace localhost with 127.0.0.1 in your connection string.
As you are using a username and password make sure SQL authentication is enabled. By default only Windows integrated is enabled on sqlserver 2008.
With SqlServer authentication keep in mind that a password policy is in place to enforce security.
Forcing the TCP/IP connection (by providing 127.0.0.1 instead of localhost or .) can reveal the real reason for the error. In my case, the database name specified in connection string was incorrect.
So, here is the checklist so far:
Make sure Named Pipe is enabled in configuration manager (don't forget to restart the server).
Make sure SQL Server Authentication (or Mixed Mode) is enabled.
Make sure your user name and password are correct.
Make sure the database you are connecting to exists.
My resolution was to login using the Windows Login then go to security>Logins locate the troubled ID And retype the used password. The restart the services...
Adding "user instance=False" to connection string solved the problem for me.
<connectionStrings>
<add name="NorthwindEntities" connectionString="metadata=res://*/Models.Northwind.csdl|res://*/Models.Northwind.ssdl|res://*/Models.Northwind.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS2008R2;attachdbfilename=|DataDirectory|\Northwind.mdf;integrated security=True;user instance=False;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
This problem was caused for me by this error which appeared just prior in the application error log.
"A read operation on a large object failed while sending data to the client. A common cause for this is if the application is running in READ UNCOMMITTED isolation level. This connection will be terminated."
I was storing PDFs in a SQL table and when attempting to SELECT from that table it spit out that error, which resulted in the error mentioned in your question.
The solution was to delete the columns that had large amounts of text, in my case Base64 encoded files.
perhaps this comes too late, but still it could be nice to "document it" for others out there.
I received the same error after experimenting and testing with Remote Desktop Services on a MS Server 2012 with MS SQL Server 2012.
During the Remote Desktop Services install one is asked to create a (local) certificate, and so I did. After finishing the test/experiments I removed the Remote Desktop Services. That's when this error appeared (I cannot say whether the error occured during the test with RDS, I don't remember if I used/tried the SQL Connection during the RDS test).
I am not sure how to solve this since the default certificate does not work for me, but the "RDS" certificate does.
BTW, the certificates are found in App: "SQL Server Configuration Manager" -> "SQL Server Network Configuration" -> Right click: "Protocols for " -> Select "Properties" -> Tab "Certificate"
My default SQL Certificate is named: ConfigMgr SQL Server Identification Certificate, has expiration date: 2114-06-09.
Hope this can give a hint to others.
/Kim
For me it was because only Windows Authentication was enabled. To change security authentication mode. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties. On the Security page, under Server authentication, select the new server authentication mode, and then click OK.
Change Server Authentication Mode - MSDN - Microsoft
https://msdn.microsoft.com/en-AU/library/ms188670.aspx
This Might help as reference
I had the same issue, after multiple trial of suggested solution on this site and others, I found a solution for my scenario. The account was locked out
How to Check if the account is Locked out...
Login to the server using higher privileged account (like SA or admin rights)
Expand security ==> select the login name ==>open the property window of the login ==> select the status page on the property window
Make sure This 3 Things
1, permission to connect database is GRANTED
2, Login is ENABLED
3, Status
SQL server authentication
Login is not locked out (Uncheck the box)
Thanks
Tsige
I just executed connection.close() by adding it as first statement and it was solved. Then i removed the line.
One follow up to this. I had installed SQL Server 2014 with only Windows Authentication. After enabling Mixed Mode, I couldn't log in with a SQL user and got the same error message as the original poster. I verified that named pipes were enabled but still couldn't log in after several restarts. Using 127.0.0.1 instead of the hostname allowed me to log in, but interestingly, required a password reset prompt on first login:
Once I reset the password the account worked. What's odd, is I specifically disabled password policy and expiration.
Another cause is if the user's default database is unavailable.
I had an account that was used for backing up two databases. When the backup user's default database was taken off-line, the "no process on the other end of the pipe" error started.
Came here looking for a solution to a similar issue, which I just introduced by changing Schannel settings of our IIS server using "IIS Crypto" by Nartac... By disabling the SHA-1 hash, the local SQL Server was not able to be reached anymore, even though I didn't use an encrypted connection (not useful for an ASP.Net site accessing a local SQL Express instance using shared memory).
Thanks Count Zero for pointing me in the right direction :-)
So, lesson learned: do not disable SHA-1 on your IIS server if you have a local SQL Server instance.
For me the issue seems to have been caused by power failure. Restarting the server computer solved it.

Delphi and mysql - Unable to connent to server..maybe custom connection reqd

I am coding an application for my company wherein i want to parse the results of a mysql query and display them in my application but i am facing a problem conecting to the database.
the ip address of the server is : 172.30.192.20
and before i can ping it i have to add route on my pc something like this
route add 172.30.192.0 mask 255.255.255.0 172.30.192.56
where 172.30.192.56 is the gateway
Now whenever i try to connect 172.30.192.20 which is where the sql server is running my appplication instead connects to 172.30.192.56
i am coding the application in delphi and have used TmySQL
After this didnt workout i tried an application called SQLwave. I just entered the server ip address and was able to connect to the database without any problems. it seems sqlwave uses mydac which is why even i tried using it but using the default connection options and setting i was still not able to connect. it seems sqlwave uses a custom connection using mydac
i just want to know whats going wrong with my connection
I tend to use the ADO Components. Here's a small (simple) example you may want to try...
Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=myDataBase; User=myUsername;Password=myPassword;Option=3;
Above is a Connection String, using the MySQL ODBC 5.1 driver (available on the MySQL website if you don't already have it). Modify this to reflect your server address, database name, username and password. Paste this into the "ConnectionString" property of a TADOQuery.
Set this ADOQuery object's SQL text to something like
SELECT * FROM mytable
Where "mytable" is the name of an existing table in your database.
Now change the ADOQuery object's Active property to True.... see what happens.
As Mason suggested, you may simply be experiencing a connectivity issue, still you never know, my method may come in handy!
Good luck!