Plugin DLL not working in Windows Server 2012 R2

I have a modified version of lib_mysqludf_sys (limits the programs that can be run). On Windows 7 Ultimate SP 1 64 bit) it works just fine. On Windows Server 2012 R2 I get:

 ERROR 1126 (HY000): Can't open shared library 'mysql_UDF.dll' (errno: 2, The specified module could not be found.

Following is more information:

C:\Program Files\MariaDB 10.1\lib\plugin>dir /q *.dll
 Volume in drive C has no label.
 Volume Serial Number is 1EBA-5D2D

 Directory of C:\Program Files\MariaDB 10.1\lib\plugin
.
.
.
10/15/2015  04:42 PM            48,456 NT AUTHORITY\SYSTEM    metadata_lock_info.dll
11/19/2015  06:46 PM            44,032 NT AUTHORITY\SYSTEM    mysql_UDF.dll
10/15/2015  04:42 PM            48,456 NT AUTHORITY\SYSTEM    query_cache_info.dll
.
.
.
              19 File(s)      5,186,832 bytes
               0 Dir(s)  338,428,325,888 bytes free

C:\Program Files\MariaDB 10.1\lib\plugin>mysql -h 127.0.0.1 -u root -p
Enter password: *********
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 2
Server version: 10.1.8-MariaDB mariadb.org binary distribution

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database EMR;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> CREATE FUNCTION sys_exec RETURNS int SONAME 'mysql_UDF.dll';
ERROR 1126 (HY000): Can't open shared library 'mysql_UDF.dll' (errno: 2, The specified module could not be found.
)
MariaDB [(none)]> show variables like '%plug%';
+-----------------+-------------------------------------------+
| Variable_name   | Value                                     |
+-----------------+-------------------------------------------+
| plugin_dir      | C:\Program Files\MariaDB 10.1\lib\plugin\ |
| plugin_maturity | unknown                                   |
+-----------------+-------------------------------------------+
2 rows in set (0.00 sec)

MariaDB [(none)]>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------/

I tried mysql version 5.7.9 and have the same error. Any ideas?

Thanks, Charles Fischer

Answer Answered by Charles Fischer in this comment.

I think I found it. In Windows 7 you can just copy the DLL to the correct location. In Windows Server 2012 R2 you must install the DLL (via .msi file for me) and then copy the DLL to the correct location.

I assume this has something to do with Microsoft's security practices.

Thanks, Charles Fischer

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.