On Thu, 5 Apr 2001, Santiago LLobet wrote:

> Hi,...
> 
>   We've got a MySQL server running with a lot of different databases that have the 
>same table-structure. 
> 
>   Does anybody knows how to make an SCRIPT that performs an administrative task 
>(like  ALTER TABLE 'table_name') in all the databases?
> 
>   Do I have to use a script like this ?
> 
>   USE database1;
>   ALTER TABLE users ..... ;
>   USE database2;
>   ALTER TABLE users......;
>   USE database3;
>   .
>   .
>   .
> 
>   (Actually the USE command does not work)
> 
>   Thanks a lot to all the people in the list!!!!   :-)

I don't see why you'd have an administrative script to perform ALTER commands. Not my 
idea of a batch job. Anyway, why don't you just give th DB name on the ALTER line:
ALTER TABLE dbname.tablename...
You write the script and execute it as:
mysql -u root -p < lala.sql

regards,
thalis


---------------------------------------------------------------------
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