Drahcir
Drahcir

Reputation: 11972

Install MySQL Plugin on Wamp

I've downloaded the windows binary from http://www.mysqludf.org/lib_mysqludf_preg/ but I'm having trouble installing it.

If I run the command SHOW VARIABLES LIKE '%plugin%' it outputs the directory 'c:/wamp/bin/mysql/mysql5.5.20/plugin' so this is where I placed the 2 dll files.

I restarted the server and then tried:

USE mysql;
CREATE FUNCTION lib_mysqludf_preg_info RETURNS STRING SONAME 'lib_mysqludf_preg.dll';

But MySQL just said: *#1126 - Can't open shared library 'lib_mysqludf_preg.dll' (errno: 2 )*

What am I missing?

MySQL version is 5.5.20

Upvotes: 0

Views: 2343

Answers (2)

fthiella
fthiella

Reputation: 49069

I tried to install the windows binary on Wamp, but I got the same error message as you.

I think that the 64-bit version of Wamp is still not supported by the standard compiled binary you can download from http://www.mysqludf.org/lib_mysqludf_preg/. I tried to disinstall the 64-bit version of Wamp, and installed the 32-bit version instead, and I was able to make it work using the following steps:

  • Copy the library libpcre.dll to the MySql bin directory (e.g. c:\wamp\bin\mysql\mysql5.5.24\bin)
  • Copy the library lib_mysqludf_preg.dll to the MySql plugin directory (e.g. c:\wamp\bin\mysql\mysql5.5.24\lib\plugin)

and then you can launch this:

USE mysql;
CREATE FUNCTION lib_mysqludf_preg_info RETURNS STRING SONAME 'lib_mysqludf_preg.dll';
CREATE FUNCTION preg_capture RETURNS STRING SONAME 'lib_mysqludf_preg.dll';
CREATE FUNCTION preg_check RETURNS INTEGER SONAME 'lib_mysqludf_preg.dll';
CREATE FUNCTION preg_replace RETURNS STRING SONAME 'lib_mysqludf_preg.dll';
CREATE FUNCTION preg_rlike RETURNS INTEGER SONAME 'lib_mysqludf_preg.dll';
CREATE FUNCTION preg_position RETURNS INTEGER SONAME 'lib_mysqludf_preg.dll';

to me it worked fine.

Upvotes: 2

Alfred
Alfred

Reputation: 21406

Try this;

Leave lib_mysqludf_preg.dll at plugin_dir

and move libpcre.dll to {MySQL Server}\bin

Then, execute "CREATE FUNCTION ...",

Upvotes: 0

Related Questions