I just installed SQL Server 2008 R2 and ColdFusion 9.0.1 on my Windows 7 machine for development use only.
I have ColdFusion running well and serving pages (that aren't connected to a database). I can view my databases in SQL Server Management Studio.
I successfully restored a few small databases and now I am trying to set up datasources for them through the ColdFusion Administrator. On my other machine, this was super easy. Not so much this time.
The database I just added is named "Test".
I am getting this error:
Connection verification failed for data source: Test java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect The root cause was that: java.sql.SQLNonTransientConnectionException: [Macromedia][SQLServer JDBC Driver]Error establishing socket to host and port: localhost:1433. Reason: Connection refused: connect
It looks like the connection between ColdFusion and SQL Server is being refused. I know, brilliant observation, right?
On my other machine, I was able to create datasources with just the default settings, no server name, username, or password.
Any clue as to what might be the cause and how I might fix it?
When you installed the SQL server, use should select "default" instance, if there was another SQL Server installation previously detected it will default to the SQLExpress. Instancing is what allows you to run and access multiple SQL Servers on a single machine.
Are you sure localhost/SQLEXPRESS doesn't work?
Are you able to setup a standard DSN using odbcad32.exe? If not, that would indicate an issue external to ColdFusion.
Probably obvious, but in SQL Configuration Manager > SQL Server Network Configuration > , I would ensure that TCP/IP is Enabled, and that the "TCP Port" is set to 1433 (probably set the "TCP Dynamic Ports" to blank). Also note that there are several entries there, one for localhost, which is what you are using to connect.
ANSWER: For some reason, using localhost or leaving blank the server name in the new datasources doesn't work. I actually had to enter "monster\SQLEXPRESS".