Copy link to clipboard
Copied
I have been able to connect my mysql database to the coldfusion 10 administrator, using the mysql(4/5) driver. However when I attempt to preform a query in a webpage I get an error page saying:
Datasource newsletter could not be found |
Here is the code snippet:
<cfquery Name="dump" datasource="newsletter" username="root" password="*******">(my password is correct)
select *
from Newsletter
</cfquery>
<cfdump var=#dump#>
ANy help would be appreciated.
I figured out what the issue was.
I had both Coldfusion 9 and Coldfusion 10 installed. It appears I was getting the database connected with Coldfusion 9 but then I was building and running on the coldfusion 10 server. Uninstalling coldfusion 9 and ensuring the datasource was connected to the coldfusion 10 administrator resolved the issue.
Copy link to clipboard
Copied
It probably won't help, but try it without the username and password. They are unnecessary.
Copy link to clipboard
Copied
You might be confusing the table name with the datasource name. Why don't you run the following code to verify the names of all the datasources:
<cfset adminObj = CreateObject("component","cfide.adminapi.administrator")>
<cfset adminLogin = adminObj.login("my_cfadmin_password")>
<cfset datasourceService = CreateObject("component","cfide.adminapi.datasource")>
<cfset datasources = datasourceService.getDatasources()>
<cfset datasourceList = structkeylist(datasources)>
List of datasources: <cfoutput>#datasourceList#</cfoutput>
Copy link to clipboard
Copied
I figured out what the issue was.
I had both Coldfusion 9 and Coldfusion 10 installed. It appears I was getting the database connected with Coldfusion 9 but then I was building and running on the coldfusion 10 server. Uninstalling coldfusion 9 and ensuring the datasource was connected to the coldfusion 10 administrator resolved the issue.
Copy link to clipboard
Copied
A curious one for the books! Please mark it as answered.