Neven Luetic <[EMAIL PROTECTED]> wrote on 09/27/2005 05:02:58 AM:

> Hello,
> 
> I have a database scheme, containing a table, whichs content should be
> unique across all databases with this scheme (on several servers as
> well). 
> 
> It would be possible to define one database, in which all changes would
> be made. But what's the easiest way to keep the table consistent in the
> other databases? 
> 
> At the moment I can only think of reimporting the whole table in all
> databases any time a change is made or when requested, what seems pretty
> awkward. Perhaps triggers would be better, but I cannot switch to 5.0
> (4.0 is used at the moment).
> 
> Any ideas?
> 
> 

Within a single server, you only need one copy of a table in one database. 
When you need data from it, just use the table's fully-qualified name and 
it won't matter which other database you are currently in (assuming that 
the account you are using has at least SELECT rights for the "master 
table"

USE mysql;
SELECT * From user;

CREATE DATABASE testme;
USE testme;
SELECT * from mysql.user;

Now to keep the table in sync between servers, use replication or the 
Federated storage engine. Remember that, outside of NDB, replication is 
only one-way! Even "circular" replication only happens in one direction 
around the circle and has some important limitations. The Federated 
storage engine is part of v5.0.

Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine

Reply via email to