Bug #71854 No uninstall info for the audit plugin
Submitted: 27 Feb 2014 6:54 Modified: 26 Apr 2015 19:38
Reporter: Daniël van Eeden (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:5.6.16 OS:Any
Assigned to: Paul DuBois CPU Architecture:Any
Tags: auditlog

[27 Feb 2014 6:54] Daniël van Eeden
Description:
There is information about how to enable/install the audit plugin, but there is no information about how to disable/uninstall the audit plugin.

If the audit-log setting is set to FORCE_PLUS_PERMANENT the generic plugin uninstall info probably won't work.

Just removing all variables from the my.cnf and restarting is not enough.

The INSTALL info:
http://dev.mysql.com/doc/refman/5.6/en/audit-log-plugin-installation.html

Generic UNINSTALL info:
http://dev.mysql.com/doc/refman/5.5/en/server-plugin-loading.html#server-plugin-uninstalli...

How to repeat:
See description

Suggested fix:
1. Remove all audit log variables from the my.cnf configuration. 

2. If audit-log is set to FORCE_PLUS_PERMANENT restart MySQL

3. Run UNINSTALL PLUGIN audit_log

4. Restart MySQL

5. Now the old audit log files may be removed

mysql> UNINSTALL PLUGIN audit_log;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> SHOW WARNINGS;
+---------+------+----------------------------------------------------+
| Level   | Code | Message                                            |
+---------+------+----------------------------------------------------+
| Warning | 1620 | Plugin is busy and will be uninstalled on shutdown |
+---------+------+----------------------------------------------------+
1 row in set (0.00 sec)
[27 Feb 2014 6:56] Daniël van Eeden
Add auditlog tag
[27 Feb 2014 8:55] MySQL Verification Team
Hello Daniel,

Thank you for the bug report!

Thanks,
Umesh
[27 Feb 2014 16:32] Paul DuBois
Daniel, is there something about this that's specific to the audit log plugin?
[27 Feb 2014 17:03] Daniël van Eeden
1. The audit_plugin prevents itself from being unloaded (FORCE_PLUS_PERMANENT), this is not true for other plugins.
2. Just removing the config and restarting is not enough, this might not be obvious to folks who have expirience with how plugins are handled.
3. uninstalling w/o removing the settings *might* cause issues (then the variables might not be known to the server)
[27 Feb 2014 17:08] Daniël van Eeden
O, the generic page does mention FORCE_PLUS_PERMANENT... so a link to that page might be fine. That page however only says that UNINSTALL won't work and doesn't tell you how to remove it...

http://dev.mysql.com/doc/refman/5.5/en/server-plugin-loading.html#server-plugin-uninstalli...
[24 Apr 2015 14:10] Paul DuBois
re:
"
1. The audit_plugin prevents itself from being unloaded (FORCE_PLUS_PERMANENT), this is not true for other plugins.
"

I don't find that to be true (prevents *itself* from being unloaded), unless I explicitly use FORCE_PLUS_PERMANANT at startup.

Nevertheless, the section does show an example that uses that option. I'll add some information to the general installing-and-uninstalling section to deal with this case.
[26 Apr 2015 19:38] Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly.

http://dev.mysql.com/doc/refman/5.6/en/audit-log-plugin-installation.html
links to
http://dev.mysql.com/doc/refman/5.6/en/server-plugin-loading.html
and the uninstalling information there is updated to cover uninstalling
plugins loaded with server options at startup.