Copy link to clipboard
Copied
I'm getting the following error message in CF11 when trying to access my MYSQL database on a local machine:
Could not create connection to database server. Attempted reconnect 3 times. Giving up.
I created the DB in the admin page. I also verified the DB. I can open the database in the command prompt. The only thing I can't do is connect it in CF11. Everything tells me the DB is connected and working fine, just not when I view the data in the web page. Any suggestions would be appreciated.
EDIT: forgot to mention the rest of the error message, I hope it helps:
The error occurred in D:/inetpub/wwwroot/Applewood Community_03/textareaTest.cfm: line 9
Called from using password: line -1
Called from using password: line -1
Copy link to clipboard
Copied
If you are able to create a datasource within the CF admin, that means, the DB connection is verified and connected.
It seems like that the issue lies in the textareaTest.cfm. Can you share the code within the page? Alternatively, you can try dumping a sample query and see if it works.
Regards,
Anit Kumar
Copy link to clipboard
Copied
You may have configured the datasource username and password in the Coldfusion Administrator. So, omit them from the cfquery tag, and use just
<cfquery name="q" datasource="myDSN">
</cfquery>