NOTE: The OP is not asking how to get data from the database command line per se. He wants to create an installer that will populate a database when the user runs the installation. For example, when you install WordPress, you are not going to run mysqldump, right? The application takes care of it. This is a similar situation.
The easiest way to do this is to use the models that come with the application.
Check to see if the system is installed, if not run the following:
- open the installer asking for the DB credentials in a form
- use the credentials to create the database
- if the database cannot be created, explain that they must create the
database manually
- save the credentials to the correct location in the database.php
config
- create the schema from within the controller
- once the schema is built, load all of the pre-set data from the
model
Take advantage of the install controller / db models within cake to do the lifting. So for example, if you want to pre-load some configuration settings:
$config['Config']['setting_1'] = 'foo';
$config['Config']['setting_2'] = 'bar';
$this->loadModel('Config');
$this->Config->create();
$this->Config->save($config);
Hope that helps.