Setting up a datasource in Coldfusion Administrator

Posted on Saturday, March 13th, 2010 at 3:26 pm

Quick post on how to set up a datasource in the Coldfusion Administrator. First you’ll want to open the Coldfusion Administrator. I’m going to assume that you will be doing this locally since if you don’t have a datasource you’ve probably are just at the beginning stages of development. As such let’s open the admin.

Working locally it is likely that you will use the following link http://localhost:8500/CFIDE/administrator/index.cfm for Coldfusion 8 and http://127.0.0.1:8500/CFIDE/administrator/index.cfm for Coldfusion 9. Remember though if you have multiple versions of the Coldfusion server running on your machine the port number may not be 8500. Instead as ports are used Coldfusion will increment the port number by 1 until reaching the next available port. So for example if you had Coldfusion 8 running, and are now running Coldfusion 9 as well your port number is most likely 8501. Nonetheless, if this is the case, my guess is that your not reading this article.

Once into the administrator click on ‘Data Sources’ under the ‘Data & Services’ tab on the left.

Data Sources menu in Coldfusion 9 Administrator

Next create a name for your datasource.  This can be whatever you want it to be.  This is the label that will represent the connection setup between Coldfusion and this particular database.  You will also need to select a driver from the drop-down.  In my case I’m using MySql 5 so I’ll choose ‘MySql 4/5′ from the drop-down.  You will choose whatever is appropriate for your particular database.


Create a datasource

Click ‘Add’ when finished.  This will open a new screen requesting more information about your database.  The ‘CF Data Source Name’ is the name of the data source you set on the previous screen.  It should be prefilled when you get to this page.  Next is the name of the actual database.  In MySql this will be the name of the Schema holding your tables.  If you’re working locally your Server is most likely ‘localhost’  the port will be 3306, and your user name will probably be ‘root’ with no password.  I know that using MySql on mac by default is root with no password, but for some reason I’m thinking that on Windows you do set up a password when installing MySql.  Don’t quote me on any of this.  Long story short, use the same credentials you use to log into MySql via the command line or the GUI Tools.  Lastly, you can add a description explaining the data source, but is not required.

I’ll just note that there are a number of advanced settings, but honestly I’ve never had a reason to mess with these.  So in all likelihood you shouldn’t either.

Detailed information about the database.

Confirm your settings, and you will be taken back to the main Data Sources page.  On this page you will get a confirmation in green at the top of the page and ‘OK’ in the ‘status’ on the new line containing the new data source in the list of available data sources on the bottom if the settings were correct.

Confirmation

If not you will receive an error message.  I’ve found in my experience that a failed connection is usually due to incorrect username and password.  Just remember if you can log into MySql, those same log in credentials will work here.

Hopefully this will be enough to get you a connection between Coldfusion and your database so you can start doing all the fun stuff.

CategoryColdfusion
23 Responses to “Setting up a datasource in Coldfusion Administrator”
  1. [...] pukkared Web Design & Development Setting up a datasource in Coldfusion Administrator [...]

  2. [...] Setting up a datasource in Coldfusion Administrator « pukkared [...]

  3. percy says:

    Hi!!!

    I’m want change http://127.0.0.1:8500/CFIDE/administrator/index.cfm to
    http://localhost/CFIDE/administrator/index.cfm how can I’m do that???

    please help!!
    percy villegas

  4. percy says:

    Hi!!!

    Please help
    Thanks
    percy
    percy_2020@llive.se

  5. Matthew Cook says:

    Hi. Since you’re running locally you will need to specify the port that Coldfusion is running on. So http://localhost/CFIDE/administrator/index.cfm will not work. However, in the other link provided, the 127.0.0.1 is your local ip so you should be able to replace it with ‘localhost’ and everything be fine. So for example http://localhost:8500/CFIDE/administrator/index.cfm should work.

    Matt

  6. Scott B says:

    Thanks! Seriously… THANKS!! There were multiple issues in setting up ColdFusion developer edition on my laptop, but this solved the final one.

  7. Matthew Cook says:

    No problem. Glad it helped!

  8. Mia says:

    Can you help me with CF8 Installation? When opening up Administration, I am getting a 404.3 error message. And when opening Builder, I am seeing Index.cfm as encryped. Any help would be appreciated as I am about to throw my laptop into the street!

    Thanks!

  9. Matthew Cook says:

    @Mia, what version of Windows are you running? Are you installing this on windows IIS? It sounds like a server configuration issue. Not knowing the installation details though makes it difficult to troubleshoot.

  10. Mia says:

    Windows 7, 64-bit
    IIS v.7.5

    We just turned off McAfee and added .cfm to the MIME directory. Shutting down once again to see if that worked!

  11. Matthew Cook says:

    You may have already done so, but if not check out the following blogs. They may provide some clues.

    CodeCurry
    Old Nabble
    Dale Fraser’s Blog

    Hope this helps.

  12. Mia says:

    Still getting DOIISlistWebSites(OpenKey): error is ERROR_ACCESS_DENIED when opening Web Server Configuration Tool. Have you ever seen this? Also still getting the encrypted index.cfm in Builder. The only difference is the server is running…????

  13. Matthew Cook says:

    hmmm… I have not seen this before. I found this on the adobe groups site. http://groups.adobe.com/index.cfm?event=post.display&postid=17392. The bottom of the post mentions this error. According to this post you need to open your wsconfig.exe and set it to run as an administrator.

  14. Mia says:

    OMYGOSH – you are the BOMB! Your last post about the
    “I’ve resolved the issue. Went into JRun4/bin/wsconfig.exe and set it to run as administrator.” worked!!!!

    BTW – are you a CF programmer?

    THANK YOU THANK YOU THANK YOU!!!!!!!

  15. Matthew Cook says:

    No problem. Glad to help. I program CF by day and Python by night :)

  16. Mia says:

    Cool! Now I need to download MySql 5. Thanks again!

  17. Mia says:

    Hi! It’s me again! I am just not starting with CF and have a very simple question! I have 2 radio buttons. I have created a CFC with 2 methods of processing there. If radio button 1 is hit, I need to cfinvoke to the CFC using a certain method and if radio button 2 is hit, then I need to invoke to the CFC using the other method. How do you check which radio button is hit?
    Below is my cfinput: (so far all is working on my main page!)

    Subscribe
    Unsubscribe

    I have this for radio #1, but it’s not working:

    <cfinvoke component="components.customers"
    method="addCustomers"

    My CFC is:

    INSERT INTO lcustomers
    WHERE firstname = #firstname#
    lastname = #lastname#
    email = #email#

    DELETE FROM lcustomers
    WHERE firstname = #firstname#
    lastname = #lastname#
    email = #email#

  18. Mia says:

    I have a CFC question. Below is my <cfform action. doesn't seem to be hitting my CFC page. Do you see a problem with this line?

    Manage:
    Subscribe

    I actually have 2 radio buttons and not sure how to call a different method for the other button. Any help would be appreciated!

  19. Vikky says:

    I am trying to configure MySQL with CF8 but i am getting following error.

    Connection verification failed for data source: kodeway
    com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.
    The root cause was that: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

  20. Thanks – so clear and simple due to your explanation.

  21. Samer Gad says:

    Hi,
    Very nice and useful article, but I have a problem, basically, that the Data Sources page in the ColdFusion Administrator doesn’t open at all. I deployed ColdFusion 9 on JBoss 6 as a WAR. Both are running on RedHat Enterprise Linux version 5 (64bit). And whenever I access the tab on Data Sources I get an error
    “coldfusion.security.SecurityManager$UnauthenticatedCredentialsException” while process CFIDE/administrator/Application.cfm. And one more strange thing, as I told you I installed and deployed a 64bit Linux version of ColdFusion, and it tells me that the error in E:\cf9_final\cfusion\wwwroot\CFIDE\….\Application.cfm!!

    Please Help!

  22. David says:

    our system always getting the error message of Connection reset by peer: socket write error when connect with the MSSQL 2005.

    Not sure are you have any idea what’s wrong with this error or not? I try to google it and most of the answer is that Client stop the page while web server still interacting with db server.

    Just to check do you have any idea or what config i can set so that can avoid this error to occur? thanks

  23. Gabe says:

    Thanks for the info, I tried it out and it worked out great!

Leave a Reply

*
(Won't be published) *