I\'m using Delphi 7 and can\'t predict the target version of Windows.
I need to create a database (probably MySql, but might be something else) and define some table
I wrote a unit and set of components to handle console redirection in delphi quite a long time ago:
http://www.fulgan.com/delphi/dospipes15.zip
But beyond that, you shouldn't have to go through that: use the ADO connection component just to connect to the database's default catalog and then use the "execute" method to create whatever database and schema you need. The database SERVER need to be properly installed and running for this to work but, at least with MSSQL, there is no problem with creating new databases this way. the exact connection string to use might change depending on the target DB, though.