Home > Archive > MySQL ODBC Connector > September 2005 > Re: Best way for maintaining a "master table" for use in several databases









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Best way for maintaining a "master table" for use in several databases
SGreen@unimin.com

2005-09-27, 9:23 am

--=_alternative 00481F8685257089_=
Content-Type: text/plain; charset="US-ASCII"

Neven Luetic <Neven.Luetic@hanse.net> 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
--=_alternative 00481F8685257089_=--
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2009 droptable.com