Welcome to WebmasterWorld Guest from 54.198.185.204

Forum Moderators: open

Message Too Old, No Replies

Updating Multiple Databases

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

Full Member

10+ Year Member

joined:May 13, 2003
posts:313
votes: 0


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

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

Moderator from US 

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

joined:Dec 10, 2005
posts:5597
votes: 28


Do you mean 100 databases or 100 tables? What DB are you using?
7:06 pm on Aug 1, 2007 (gmt 0)

Administrator

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

joined:Aug 10, 2004
posts:10551
votes: 10


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members