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.

TIA

    6 days later

    It all depends on what database you're using. For Postgres, for example, you would call:

    psql -U user -f /home/me/myfile.sql mydatabase

    from the shell. Since this is a VB project, I doubt that you're using postgres, so you would have to look at running command line scripts specific to the database server.

    Because of this, consider using a database abstraction layer and calling everything from a php script. This will allow your project to be very portable amongst database systems and not be tied down to using specific command line programs.

    HTH

    Melody

      Sorry, didn't read that you were using MySQL :-~

      Doing a quick lookup on the mysql command line suggests that you'd be better off calling it all from a php script.

      Melody

        thanks, found it in the manual, shoulda looked at command line first 🙁 ...but i thnk what i found there will siut my needs

        for edification

        mysql> db_name <script.sql>

        thanks

          Write a Reply...