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
Solved

Execute MySQL .sql files in an Inno Setup Installer

Posted on 2009-07-08
2
7,011 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
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
I have been scripting applications way too long and can never remember how to create an ISS file.  So I decided to write this article to act as my own knowledge base for future reference, and hope you will also benefit. An ISS file is a response …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

808 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