I all,
I have a series of MYSQL databases with different users and passwords, nevertheless the DB structure is the same for all databases. I can't create a user with the same username and password to all of them and I need to quickly perform operations on all of them.
I was thinking about a bash script to run via cron.
Any suggestion? I was thinking to something like this but it is not working :(
#!/bin/bash
uconn=(
'mysql -u user_db1 --password=pass_db1 db1 '
'mysql -u user_db2 --password=pass_db2 db2 '
)
for f in "${uconn[@]}"
do
exec ${f}
echo `mysql show tables`
echo `mysql exit`
done
exit