Welcome to WebmasterWorld Guest from 54.163.35.238

Forum Moderators: open

Message Too Old, No Replies

Updating Multiple Databases

     

humpingdan

9:03 am on Aug 1, 2007 (gmt 0)

10+ Year Member



I need to update 100 databases, we have a default username and password in each database in the table staff.

We need to change this username and password for each occurance in each database.

Its the admin pass and user for each website, the ID of the Admin account is different in each database so will have to update by firstname and surname.

update staff
set username "AdminNew"
set password "passNew"
where fname = "Administrator"

but across 100 databases

Any help apreciated

LifeinAsia

3:23 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Administrator lifeinasia is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



Do you mean 100 databases or 100 tables? What DB are you using?

phranque

7:06 pm on Aug 1, 2007 (gmt 0)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



if the table has the same data in all 100 db's, you could create the table in one db, dump it, and then import it into the other 99.

or you could create a script that generates 100 files containing the proper update sql for each db and then another script to feed the correct sql file as input into the correct db.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month