1 Reply Latest reply on Mar 22, 2016 1:57 AM by haxtbh

    Create DataSouce using API

    antonyn46527023 Level 1

      I want to create DataSource using ColdFusion Administrator API. All my credential are correct that's for sure. I have followed this tutorial and also Adobe Tutorial. I don't know what am doing wrong in here.

       

      <cfset adminAPI = createObject( 'component', 'cfide.adminapi.administrator' ) />

      <cfset adminAPI.login( 'CFAdminPass', 'admin' ) />

      <cfscript>

        dsnAPI = createObject( 'component', 'cfide.adminapi.datasource' );

        dsn = {

        driver = 'mysql5',

        name = 'cfdb',

        host = 'localhost',

        port = '3306',

        database = 'cfdb',

        username = 'root',

        password = 'mysqlpass'

        };

        // Finally, we save the new datasource

        dsnAPI.setMySQL5( argumentCollection = dsn );

      </cfscript>