|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Programattically CREATE DATABASE in MySQL
Hi all:HCI 01/19/12 12:54 P I think you'll want to look into the ColdFusion Administrator API. ThereMatt Quackenbush 01/19/12 01:40 P Hi Matt,AJ Mercer 01/19/12 05:47 P Oops. Ayep, that's exactly what I was thinking. That's what I get forMatt Quackenbush 01/19/12 06:44 P I have something similar working so, maybe it's a permissions issue.Rex 01/19/12 05:03 P Hi all: I've been presented with an interesting problem for which I seem to have hit a wall. I have an app wherein it would be very handy to be able to have the CF code create a new database as needed IN MySQL. I've tried the straight CREATE DATABASE AAA in a CFQUERY with an existing datasource and get an exception error reading "Encountered "DATABASE" at line xxx". I've tried doing the entire SQL string as a variable. I'm considering putting it in as a stored proc on an existing database and passing in the new database name...but nothing works. I saw an earlier thread here that seemed to allude to being able to do this but with no specific examples. Any help would be greatly appreciated. Thanks in advance! I think you'll want to look into the ColdFusion Administrator API. There are hooks for doing just these types of tasks programmatically. If you are on Railo, it also has an API exposed that allows these tasks (<cfadmin> tag, I think?). I've never used OpenBD, but I assume that it exposes something of the sort as well. HTH On Thu, Jan 19, 2012 at 11:54 AM, HCI <cf.contractor@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Hi Matt, Are you thinking of the admin API to create the dsn? On 20 January 2012 02:39, Matt Quackenbush <quackfuzed@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- Oops. Ayep, that's exactly what I was thinking. That's what I get for skimming! Sorry! I'll go back to sleep now. ;-) On Thu, Jan 19, 2012 at 4:47 PM, AJ Mercer <ajmercer@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- I have something similar working so, maybe it's a permissions issue. Try the CREATE DATABASE AAA code with a DSN that's using the root user. Once you've confirmed it works, lock it down from there. - Rex On 1/19/2012 9:54 AM, HCI wrote: ----- Excess quoted text cut - see Original Post for more -----
|
June 20, 2013
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||