Skip to main content
Inspiring
August 27, 2014
Question

Error connecting to DB in CF11, please help?

  • August 27, 2014
  • 2 replies
  • 285 views

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

    This topic has been closed for replies.

    2 replies

    BKBK
    Community Expert
    Community Expert
    September 2, 2014

    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>

    Anit_Kumar
    Community Manager
    Community Manager
    September 1, 2014

    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