10bet网址
我的SQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr)- 41.6Mb
PDF (A4)- 41.7Mb
Man Pages (TGZ)- 262.5Kb
Man Pages (Zip)- 372.6Kb
Info (Gzip)- 4.0Mb
Info (Zip)- 4.0Mb
Excerpts from this Manual

5.6.5.1 Installing or Uninstalling ddl_rewriter

This section describes how to install or uninstall theddl_rewriterplugin. For general information about installing plugins, seeSection 5.6.1, “Installing and Uninstalling Plugins”.

Note

If installed, theddl_rewriterplugin involves some minimal overhead even when disabled. To avoid this overhead, installddl_rewriteronly for the period during which you intend to use it.

The primary use case is modification of statements restored from dump files, so the typical usage pattern is: 1) Install the plugin; 2) restore the dump file or files; 3) uninstall the plugin.

To be usable by the server, the plugin library file must be located in the MySQL plugin directory (the directory named by theplugin_dirsystem variable). If necessary, configure the plugin directory location by setting the value ofplugin_dirat server startup.

The plugin library file base name isddl_rewriter. The file name suffix differs per platform (for example,.sofor Unix and Unix-like systems,.dllfor Windows).

To install theddl_rewriterplugin, use theINSTALL PLUGINstatement, adjusting the.sosuffix for your platform as necessary:

INSTALL PLUGIN ddl_rewriter SONAME 'ddl_rewriter.so';

To verify plugin installation, examine theINFORMATION_SCHEMA.PLUGINS表或使用SHOW PLUGINSstatement (seeSection 5.6.2, “Obtaining Server Plugin Information”). For example:

mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS, PLUGIN_TYPE FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'ddl%'; +--------------+---------------+-------------+ | PLUGIN_NAME | PLUGIN_STATUS | PLUGIN_TYPE | +--------------+---------------+-------------+ | ddl_rewriter | ACTIVE | AUDIT | +--------------+---------------+-------------+

As the preceding result shows,ddl_rewriteris implemented as an audit plugin.

If the plugin fails to initialize, check the server error log for diagnostic messages.

Once installed as just described,ddl_rewriterremains installed until uninstalled. To remove it, useUNINSTALL PLUGIN:

UNINSTALL PLUGIN ddl_rewriter;

Ifddl_rewriteris installed, you can use the--ddl-rewriteroption for subsequent server startups to controlddl_rewriterplugin activation. For example, to prevent the plugin from being enabled at runtime, use this option:

[mysqld] ddl-rewriter=OFF