?
Solved

Execute MySQL .sql files in an Inno Setup Installer

Posted on 2009-07-08
2
Medium Priority
?
7,343 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

752 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