MySQL Forums
Forum List  »  InnoDB

Re: Alter table across muliple db's with almost same name
Posted by: Muhammad Omair
Date: February 02, 2016 08:20AM

You can try sth like below. Replace $DBHOST with your dbhost name and $SQL_Query with your sql query.

for i in `mysql -h$DBHOST-e "SHOW DATABASES LIKE '%test%'"`; do echo $i; mysql -D$i -e "$SQL_QUERY"; done

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Alter table across muliple db's with almost same name
776
February 02, 2016 08:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.