programmatically run a sql file



Hi Guys,

I am working on creating an install package for an application (uses Apache, MySQL, PHP). I have the table structures in a install.sql file that I need to run to create the base tables for the application.

The installer is a VB exe.

Can any one tell me how to include the install.sql file to create the base tables? As well, I need to run a sql to create new user accounts and drop the basic default accounts that come with the MySQL install.

Should I be using PHP to do this? I could work this out, but I know I can run the SQL files. I just need a pointer or two on how to do this.


mysql has a command line syntax utilty as "source" which uses the a file and executes the content in it on the mysql,