MySQL grant use?

Alex Dean alex at crackpot.org
Fri Jul 23 06:34:38 MST 2010


On Jul 23, 2010, at 1:00 AM, der.hans wrote:

> moin moin,
>
> is there a way see when a particular grant was last used in MySQL? I  
> can
> probably troll logs, but I wonder if it's in the DB.

I don't think that's logged anywhere.

>
> Also, how should I sync grants from master to slave when they're out  
> of
> sync?

Dump the 'mysql' database on the master, and load it on the slave.

If the slave has a different set of user accounts, I think you'll have  
to manually create what you want on the slave.  In that case,  
configure the master to not replicate the 'mysql' database so your  
changes on the master won't affect the slave.

>
> In our case, the slave is also getting local changes. I'm pushing to  
> stop
> that, but haven't yet gotten it worked out. The local changes to the  
> slave
> didn't drop the missing grants, but since we've had emergency repairs
> after local changes caused problems, it might be that the repairs did
> cause the differences.

Hm.  Are users on the slave modifying tables which get replicated from  
the master?  That's grandma's recipe for data stew.  You can't do that  
if you have any interest in data integrity.  If the slave has some  
tables which only exist on the slave, that's probably not a huge  
issue.  If you want to describe the situation in a little more detail  
we can help comment further on how bad/not-bad it all is. :)

alex


More information about the PLUG-discuss mailing list