Hi,

The purpose of the execute parameter I to execute a command and then
quit; An example of how to use the "--execute" or "-e" parameter
follows:

Prompt> mysql -e "select * from user" mysql
[prints everything from mysql.user to stdout]

If you want to execute the contents of a file through the console, you
would do something like:

Prompt> mysql --user=USER --password=PASSWORD DATABASE  < WI_UPUSER.sql

Regards,
Jorge

For technical support contracts, visit https://order.mysql.com/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Jorge del Conde <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Full-Time Developer
/_/  /_/\_, /___/\___\_\___/   Mexico City, Mexico
       <___/   www.mysql.com



-----Original Message-----
From: Järkeborn Joacim [mailto:[EMAIL PROTECTED]] 
Sent: Friday, July 13, 2001 1:40 AM
To: [EMAIL PROTECTED]
Subject: Execute multiple scripts


Hi,

I have approx. 110 SQL scripts in a directory. Each containing DROP
TABLE, CREATE TABLE, lots of INSERT INTO and finally a COMMIT. I need to
run all these script in mysql console.

My plan is to write a perl script that looks into the directory and
fetch all *.sql scripts and then execute them in mysql console. But I
can't running the mysql console with a script as parameter. I have tried
the following commands:

mysql --user=USER --password=PASSWORD DATABASE \.
C:/Files/data/WI_UPUSER.sql mysql --execute=C:/Files/data/WI_UPUSER.sql
--user=USER --password=PASSWORD DATABASE

None of them works!

How can I do this?

BR
Joacim

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to