CFConfig Documentation
  • Introduction
  • The Basics
    • About This Book
    • Authors
    • Overview
    • Getting Started Guide
    • Supported Engines
    • Config Items
  • Using the CLI
    • Installation
    • Usage
    • CommandBox Server Interceptors
      • Server Start
      • Server Stop
    • Command Overview
      • Export Settings
      • Import Settings
      • Transfer Settings
      • Diff Settings
      • Set/View Settings
      • Manage Datasources
      • Manage CF Mappings
      • Manage Caches
      • Manage Mail Servers
      • Manage Event Gateway Configuration
      • Manage Event Gateway Instances
      • Manage Lucee Loggers
      • Manage Scheduled Tasks
    • JSON File Storage
    • Env Var Overrides
  • Using the Services
    • Installation
    • Component Overview
    • API Overview
Powered by GitBook
On this page
  • List all datasources
  • Edit an existing or create a new datasource
  • Delete a datasource

Was this helpful?

Edit on GitHub
Export as PDF
  1. Using the CLI
  2. Command Overview

Manage Datasources

There are three commands to manage datasources.

List all datasources

cfconfig datasource list
cfconfig datasource list from=serverName
cfconfig datasource list from=/path/to/server/home

To receive the data back as JSON, use the --JSON flag.

cfconfig datasource list --JSON

Edit an existing or create a new datasource

Add a new datasource or update an existing datasource. Existing datasources will be matched based on the name. Valid dbdriver options are

  • MSSQL -- SQL Server driver

  • MSSQL2 -- jTDS driver

  • PostgreSql

  • Oracle

  • Other -- Custom JDBC URL

  • MySQL

cfconfig datasource save name=myDSN dbdriver=mysql host=localhost port=3306 database=myDB username=brad password=foobar
cfconfig datasource save name=myDS ... to=serverName
cfconfig datasource save name=myDS ... to=/path/to/server/home

Delete a datasource

Identify the datasource uniquely by the name.

cfconfig datasource delete foo
cfconfig datasource delete foo serverName
cfconfig datasource delete foo /path/to/server/home
PreviousSet/View SettingsNextManage CF Mappings

Last updated 3 years ago

Was this helpful?