Link to home
Start Free TrialLog in
Avatar of jimmycdinata
jimmycdinataFlag for Indonesia

asked on

How to alter a table in all MySQL databases?

Experts,

I have multiple databases in my environment. Every user have one database with multiple tables.

1. Is this an effective solutions?
2. How to alter a table in all MySQL databases, if I need some changes?

Thanks.
Avatar of wiredpea
wiredpea
Flag of Netherlands image

It can be effective. In my company we use it too and it works great because we can buy chepers hardware that one really big server.

http://dev.mysql.com/doc/refman/5.0/en/replication.html

But remember that you make one server a 'master' and do all updates / inserts / deletes there, you can do selects one any of them. So you actually need to do a lot more selects then other queries.
ASKER CERTIFIED SOLUTION
Avatar of xterm
xterm

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of xterm
xterm

Sorry, I left the closing semicolon out on line #5.  It should read:

$sql="ALTER TABLE xxx etc.";

Obviously, your own query goes in there, not mine.
Avatar of jimmycdinata

ASKER

Thanks for pointing the solutions.