Solved

Execute MySQL .sql files in an Inno Setup Installer

Posted on 2009-07-08
2
7,211 Views
Last Modified: 2013-11-09
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

0
Comment
Question by:mainemoose
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 18

Expert Comment

by:mirtheil
ID: 24805568
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

0
 
LVL 2

Accepted Solution

by:
mainemoose earned 0 total points
ID: 24805893
Oh, I found it :)
[RUN]
Filename: "{pf}\MySQL\MySQL Server 4.1\bin\mysql.exe"; \
Parameters: "-e ""source create_db.sql"""; \
Flags: waituntilterminated runhidden;

Open in new window

0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
In this blog post, we’ll look at how ClickHouse performs in a general analytical workload using the star schema benchmark test.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question