cat /lists/dbs | while read i ; do echo $i; /path/to/mysql -h $i -e "SHOW variables like 'old%'"; done
This programming one liner allows you to run a command on multiple MySQL hosts. To use this command, simply create a file dbs with all the MySQL hosts (one per line). The sample command prints the value of whether the database is using old passwords.
2 comments:
Here's a different way:
xargs -n 1 mysql -e "..." -h < /lists/dbs
Thanks Toby for the alternative way.
Frank
Post a Comment