Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email email@example.com
From: Baron Schwartz (baronxaprb.com)
Date: Wed Mar 04 2009 - 07:00:26 CST
On Wed, Mar 4, 2009 at 7:25 AM, Thomas Spahni <tsplawbiz.ch> wrote:
> I'm stuck with the following problem:
> SLAVE has a bunch of databases of which one or two are replicated from
> I'm writing a shell script to be run by an ordinary user on SLAVE. This
> script should know which of the databases on SLAVE are replicated.
> Configuration: MASTER has --binlog-do-db rules. These determine what goes to
> binlog and will be replicated by SLAVE. SLAVE has no --replicate-do-db
> On SLAVE I can find who the master is (SHOW SLAVE STATUS; will tell) but I
> can see no way to find what databases are logged by MASTER.
> User on SLAVE has no access to the replication user password on SLAVE and
> has no access to MASTER (otherwise mysql -h MASTER -e "SHOW MASTER STATUS,"
> would do the trick).
> Any other way to make the SLAVE tell me what is's replicating?
No. But I would recommend removing binlog-do-db and using
replicate-wild-do-table=<mydb>.% on the slave instead. The
binlog-do-db approach has many pitfalls anyway, and is likely to burn
you at some point, e.g. get the slave out of sync with the master.
The bonus of my suggestion is that you'll be able to see from SHOW
SLAVE STATUS what's being replicated.
Baron Schwartz, Director of Consulting, Percona Inc.
Our Blog: http://www.mysqlperformanceblog.com/
Our Services: http://www.percona.com/services.html
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql