当前位置: 动力学知识库 > 问答 > 编程问答 >

mysql - Uploading a Coldfusion Website

问题描述:

So, I've created a site; using Mysql 5, Coldfusion 8 and Dreamweaver CS3. I have a 'GoDaddy' windows hosting plan - and have just uploaded my database. I have uploaded my site - But it doesn't work! I have an index.cfm page, so it should work, my URL's are correct. I'm not sure why thats not working!!

Also, I am woundering if I need to put some code in my Application.cfc page that connects my site to my database on godaddy, as example:

DRIVER={MySQL ODBC 3.51 Driver}; SERVER=bridgettips.db.5452582.hostedresource.com; PORT=3306; DATABASE=bridgettips; USER=bridgettips; PASSWORD='invu4uraqT'; OPTION=0;

Or do I need to put something in my 'server' and 'Port' box - it is Server - localhost Port - 3306 at present, in Coldfusion.

Also, there is a problem with saving my pages and editing recordsets now - it says that it requires a 'cold Fusion data source'. I think this may be becasue in dreamweaver is changed localhost:8500 to my URL....? (Do you think this is why it no longer works?)

Sorry about so many qustions! It's only that I have had my hosing plan for about 10 days now - and its costing me a lot! I need to have it working asap!

Thanks for any help at all....

网友答案:

Steven,

I have tried to use GoDaddy as a CF host, and personally cannot recommend them. In my opinion, they have no business trying to host CF.

I can recommend another host which I use, but I'm not sure it's proper to name it here. (Perhaps someone else can chime in and educate me on this?)

As for your Datasource issue - you most likely need to let GoDaddy know that you need a DSN - now they may have a way for you to do that yourself, but sometimes it's the provider who must set that up for you.

Also, keep in mind that when you are in the hosted environment, you'll need to create any mappings you have locally, and if you are using any paths for cffile and the like, they will be different on the host than locally.

You can set up some variables in application.cfc for that, to switch based on the IP address. Let me know if you need some help with that and I'll be happy to post some code samples for you.

网友答案:

You will need to create a DSN for your datasource in order to get it to work. In the GoDaddy Hosting Control Panel there is a DSN option under the "Databases" pull-down menu. Once you've got the DSN created, just use the name of the DSN in the "datasource" attribute of your queries and you should be good to go. That should solve both of the issues that you're having.

分享给朋友:
您可能感兴趣的文章:
随机阅读: