0

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

1
  • are you sure that you use the right directory ? This kind of behavior happens when we have several version of WAMP installed . Commented Sep 20, 2012 at 9:41

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

Try this;

Leave lib_mysqludf_preg.dll at plugin_dir

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

Then, execute "CREATE FUNCTION ...",

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.