Skip to main content
Inspiring
November 4, 2010
Question

Need help with setting up datasource

  • November 4, 2010
  • 3 replies
  • 730 views

Hi!

I'm working on a CF project on my local machine but the DB is located on the hosting site so I have no access to their CF administrator and can't set the datasource.

So I was suggested by the hosting company to work from my local but connect the datasource to their MySQL DB remotely. I was told that I need to use certain IP address they gave me and also the database name, user name and password but I'm not sure how to set this up from my code.

Have googled for awhile and did not get any result. Is there anyone in this forum know how and willing to send example for me so I can start working?

Thank you so much

This topic has been closed for replies.

3 replies

mega_LAuthor
Inspiring
November 4, 2010

Oh wow, that's cool, I did not expect it is that easy. Thank you so much guys!!!

Participating Frequently
November 4, 2010

Set the datasource on your machine, but use their IP as the server address.

Do this in your local CF administrator.

Matt Gifford
Participating Frequently
November 4, 2010

Hi mega_L

As you have access to the ColdFusion administrator on your local environment, you can set up the access to the remote datasource in exactly the same way as you would to a local database.

CF Data Source Name: Whatever_You_Want_To_Call_It

Database: Name_Of_The_Database_On_The_Server

Server: The IP Address provided by your hosting company

Port: As MySQL database, this should still be 3306 (but check with the hosting provider)

Username and password: as provided by your provider.

As long as the hosting provider has enabled external access to the database (which I'm assuming they have if they've sent you the connection details), you should now have access to the remote data source on your local ColdFusion install.