comprehensive documentation repository

MySQL 5.5 Reference Manual

14.5.3.7. Using the MySQL memcached UDFs

The memcached MySQL User Defined Functions
(UDFs) enable you to set and retrieve objects from within MySQL
5.0 or greater.

To install the MySQL memcached UDFs, download
the UDF package from http://libmemcached.org/.
Unpack the package and run configure to
configure the build process. When running
configure, use the
--with-mysql option and specify the location
of the mysql_config command.

You must repeat this process for each function that you want to
provide access to within MySQL. Once you have created the
association, the information is retained, even over restarts of
the MySQL server. You can simplify the process by using the SQL
script provided in the memcached UDFs
package:

shell> mysql <sql/install_functions.sql

Alternatively, if you have Perl installed, then you can use the
supplied Perl script, which checks for the existence of each
function and creates the function/library association if it is
not already defined:

shell> utils/install.pl --silent

The --silent option installs everything
automatically. Without this option, the script asks whether you
want to install each of the available functions.

The interface remains consistent with the other APIs and
interfaces. To set up a list of servers, use the
memc_servers_set() function, which accepts a
single string containing and comma-separated list of servers:

Set behaviors for the list of servers. These behaviors are
identical to those provided by the
libmemcached library. For more
information on libmemcached behaviors,
see Section 14.5.3.1, “Using libmemcached”.