tags:

views:

40

answers:

1

This is what I currently have:

#!/bin/bash
# Shell script to backup MySql database

MyUSER="root"
MyPASS="password123"

MYSQL="$mysql"
MYSQLDUMP="$mysqldump"

# Store list of databases
DBS=""

# Get all database list first
DBS="$($MYSQL -u $MyUSER -h -p$MyPASS -Bse 'show databases')"

for db in $DBS
do

The problem i have is the 'do' bit,

I need to write this into the shell.

After getting all the DB names do the following:

updated user set password="passowrd" where id = 999;

Can anyone assist?

+1  A: 

try

for db in $DBS
do
    $MYSQL -u $MyUSER -h -p$MyPASS -Bse "update $db.password='password' whereid =999;'
end

as you can easily access a table by databasename.tablename in mysql.

johannes