I remember reading about someone inquiring about including the user's
information in each query logged to the binlog. Neither "mysqlbinlog" or
"show binlog events" shows which user performed which changes to the
database (at least for me:4.1.1a-alpha-nt-log / binary distro ) . Is that
information available somewhere else?
Have you read about the general log (--log option)?
Example: Time Id Command Argument 040520 20:12:20 3 Connect [EMAIL PROTECTED] on 040520 20:12:27 3 Init DB test 3 Query show databases 3 Query show tables 3 Field List t1 040520 20:12:30 3 Query select * from t1 040520 20:12:31 3 Quit 040520 20:12:47 4 Connect [EMAIL PROTECTED] on 4 Query SHOW SLAVE HOSTS 4 Binlog Dump
Column 3 contains the connection id. To find out who performed a given query, follow the log back to the "Connect" command. It will also show you user and host.
Hans-Peter
> just spent the last hour or so
trying to dig that old thread out of the archives (I have been using Google and the search page at lists.mysql.com) but I just can't seem to find it. Could someone please help point me back to that old thread?
May I humbly suggest a startup flag/variable that will permit integrating the users name _and_ their IP address as metainformation (comments) into the binlog? I just reread the online documentation and didn't see a task of that nature in any of the ToDos. IMO having the userid and IP address in the binlog would be very useful in disaster analysis. I am not as interested in what queries they run as much as what data they change but those two basic pieces of information would go a LONG way to track down who screwed up the data. (Yes, I DO plan to restrict direct access to the actual server and have an application handle the majority of the data requests and updates. For those power users who feel they "must" have direct data access, I plan on giving them read-only access anyway. The extra information will help me figure out who did what if things still go sour.)
Any other thoughts out there?
Thanks! Shawn Green Database Administrator Unimin Corporation - Spruce Pine
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]