ERROR 1126 (HY000): Can't open shared library 'lib_mysqludf_sys.so' (errno: 193 )

22.1k Views Asked by At

I am using MySQL 5.6.11 running on 32-bit Microsoft Windows XP (Professional Version 2002 Service Pack 3). I am interested in installing the MySQL sys_exec UDF.

The following command,

mysql> SHOW VARIABLES LIKE 'plugin_dir';

shows the following plugin location.

+---------------+-----------------------------------------------------+
| Variable_name | Value                                               |
+---------------+-----------------------------------------------------+
| plugin_dir    | C:\Program Files\MySQL\MySQL Server 5.6\lib\plugin\ |
+---------------+-----------------------------------------------------+

Where I pasted lib_mysqludf_sys.so. Then running the following command,

CREATE FUNCTION sys_exec RETURNS INT SONAME 'lib_mysqludf_sys.so';

from the MySQL command line results in the following error (after login has been made into the root user and an already created database has been selected).

ERROR 1126 (HY000): Can't open shared library 'lib_mysqludf_sys.so' (errno: 193 )

How to fix this error?

Is msvcp110.dll needed under C:\WINDOWS\system32? It is not available there. The file msvcp100.dll is however, located under C:\WINDOWS\system32.

2

There are 2 best solutions below

1
Bhushan On

You have to create a .dll file instead of creating .so file. .so file is used in Linux & .dll file is used in windows.

Check OS of your Mysql server by running below query.

show variables like 'version_compile_os'

create a dll file for same os version in windows.

To change the platform step in VS 2010 is as below.

Right click on project >> Click on Configuration Manager(Upper right side) >> Platform (if Mysql server is win32 then choose Win32 & if MySQL server is win64 then choose x64 Or win64 over here.)

Now create a dll file properly as do the same step as you mentioned. I hope it will work properly.

0
ship shuk - www.shipshuk.com On

Looks like make.exe you are running using cygwin or 32 bit. If you are using Netbeans I suggest to check your Tool Collection Settings (Tools->Options). See if you are using mingw32-make.exe for make command.

Compiling on MYSQL is somewhat painful as there are many moving parameters between versions and operating systems. if you like to walk thru all compilation process from scratch the following repository is a good place to look at

https://github.com/esabilbulbul/mysql-udf-windows