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

Tiny picture Tiny · Feb 21, 2015 · Viewed 14.9k times · Source

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.

Answer

Bhushan picture Bhushan · Jul 24, 2017

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.