Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Coldfusion syntax for successful put of DW files

Guest
Dec 05, 2007 Dec 05, 2007
I successfully setup mysql and coldserver on my own system, and got DW to access my database locally. However, after I FTP the DW files to my hosting server and run the login.cfm page, an error comes up saying it cannot access the database. I assume it's because I haven't written down the host, username, password for my database anywhere in my code yet. I run an Application.cfm page with a variable name set for my actual database. I've even tried deleting the variable code and just put in the name of the database itself on the login page--no luck. Anyway, do I have to put in the host, username, password somewhere in order to access the database? Where do I put this code--on the Application.cfm page or on the login page? OR is there some connection I have to make between DW and database? I've tried this, but does not work because my host company won't allow remote access. Bottom line: What is the exact coldfusion syntax for connecting to database, and where do I put that syntax?
TOPICS
Database access
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
You set up the data source in the ColdFusion Administrator. It's under Data & Services - Data Sources. After you point to your database you give it a data source name, you'll use this in your queries.

<cfquery name="JustANameForNow" datasource="TheNameIUsedInCFAdmin">
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
Ok, went into CDAdmin, tried to establish connection to database, and it doesn't work.

Connection verification failed for data source: Request.DSN
com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection timed out: connect STACKTRACE: (then a whole bunch of java.net mumbo jumbo)

So, is there anything I need to do on the server side with respect to CF in order to connect to the CFAdministrator? How does the code know to route through CFAdmin in the first place--simply because I have a CF tag? How does it know which account to go to? OR is your recommendation only applicable if I'm testing locally? Sorry for the stupid questions, I'm new.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
If I could connect CFAdmin to my database, then couldn't I connect directly to my database through Dreamweaver? The host is telling me I'm not allowed to remotely connect. I'm really lost now.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Dec 05, 2007 Dec 05, 2007
I don't use Dreamweaver, but wouldn't this be an RDS issue? I still use ColdFusion Studio, but in order for me to "view" my data sources in Studio, I have to have RDS configured on my ColdFusion server and set up my develoment mapping in Studio. (Which would not be recommended on your production sites.) I assume that Dreamweaver does something similar.

Phil
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
"How does the code know to route through CFAdmin in the first place--simply because I have a CF tag?"

When you write your query tag the Datasource looks within the CF Admin to the data sources of the same name.

Unfortunately I don't know squat about setting up MySQL and CF. I would imagine you'd point CF to your MySQL database, also remembering to enter and login information under the CF Username and Password.

If you're getting a timeout message you may want to check the connection between your web server and database server is correct.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
"I would imagine you'd point CF to your MySQL database, also remembering to enter and login information under the CF Username and Password. "

How do I "point?" Is this the CFAdmin connection? Still lost on how my files (after FTP'ed to my host server) will look toward the CFAdmin page and subsequently find the connection to the database. My query tags will have reference to my connection, but how does it know which CFAdmin user I am?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
Do you have access to the CF Admin or is this at a hosted location?

In the CF Admin - Data & Services - Datasources there is a "Add New Data Source", here you give the data source name (which is referenced in the cfquery tag). You also pick the driver type here (MySQL). You then enter the server and database name, along with user name and password. With SQL Server I enter the name of the server and the database that is within that SQL instance.

If you are going the hosted route there should be help files on how to set up your data source. When I've gone this route I would FTP my Access db and then email the tech support the location and data source name I would like. They would do all of the work I listed above in the 2nd paragraph.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 05, 2007 Dec 05, 2007
Do this troubleshooting step first. I will try to help you isolate the problem.

Complete the DSN in COldfusion. Use a bad username and password. Hit the Verify Connection bottom for the database DSN(second of the three bottoms under action ). Please read me exactly the error message.

DO the same thing with a correct UerID and a bad password. Read me the return errror message.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
Guys, Thanks for the help so far. I'm currently at my primary job, so my troubleshooting will have to wait until tonight. I'll try these steps when I get home!! Thanks again
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
...and while I'm waiting impatiently to get back to my project, riddle me this....

My website files are hosted at company x, and my database is hosted by company y (i.e. neither hosted directly on my computer). Company y was an automatic partner as a result of hosting with company x. I purchased CF with company x to run with my database. The only configuration I can do on the hosting site with CF is set the DSN, so I have a ColdFusion DSN. SO, just so I'm clear, my coldfusion admin that I set up on my own computer is going to run the connection between company x and y? This just doesn't sound right to me. It seems like there should be something in my coding to force it to point to my CF DSN. I don't see anyway to open a CFAdmin-type page on company x or y's pages. So, I'm terribly confused about how my webpages can have a prayer of connecting to database.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 05, 2007 Dec 05, 2007
LATEST
Thank you sirs, I've got it up and running with all your help!! Regards,

Chris
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources