Link to home
Start Free TrialLog in
Avatar of mainemoose
mainemooseFlag for United States of America

asked on

Execute MySQL .sql files in an Inno Setup Installer

I have been working on an installer that does several things. The part I'm having trouble with is getting some .sql files to set up the database, user, permission, and initial table structure for the application.

For reference, I am using MySQL 5.1 and Inno Setup 5 on Windows XP.

Using the [Run] section to run the command line mysql didn't work because it wouldn't allow the file to be piped in.

Any suggestions would be greatly appreciated.
[Run]
; this doesn't work
Filename: "c:\program files\mysql\mysql server 5.1\bin\mysql.exe"; Parameters: " -u user < file.sql "

Open in new window

Avatar of Mirtheil
Mirtheil
Flag of United States of America image

What do you mean by "doesn't work"?  
Looking at the Run command, the "user" may be causing you a problem.  
What do you get if you run the exact same thing from a command prompt?  I used the following and it seemed to work:

[Run]
; this doesn't work
Filename: "c:\program files\mysql\mysql server 5.1\bin\mysql.exe"; Parameters: " -u root < file.sql "

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of mainemoose
mainemoose
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial