On 13-Jul-01 Järkeborn Joacim wrote:
> 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?
mysql db < myscr.sql
or you put a bunch in sequence:
glpost001.sql
glpost002.sql
glpost003.sql
...
cat glpost*.sql | mysql db
Regards,
--
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.
---------------------------------------------------------------------
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