Copy link to clipboard
Copied
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>
Copy link to clipboard
Copied
What is happening when you do this? Are you getting an error, have you checked the logs?