MySQL throws Error 1124 when a full or relative file path is supplied in CREATE FUNCTION or INSTALL SONAME; the server accepts only the library name found in plugin_dir.
MySQL Error 1124: ER_UDF_NO_PATHS occurs when a CREATE FUNCTION or INSTALL SONAME statement includes a file path. Copy the .so or .dll into your server’s plugin_dir and recreate the UDF using only the library name to clear the error.
No paths allowed for shared library
Error 1124 (HY000): No paths allowed for shared library
appears while installing a User Defined Function (UDF) or component.
The server rejects absolute or relative paths for security. It expects only the shared library filename located inside the directory specified by the plugin_dir
system variable.
The error shows up during CREATE FUNCTION ...
SONAME
, INSTALL SONAME
, or INSTALL COMPONENT
when the argument contains /
, \
, or a drive letter.
It also occurs if the shared object is not already present in plugin_dir
, prompting users to try referencing a path.
The server’s security policy disallows loading shared objects from arbitrary locations.
A misconfigured plugin_dir
or missing file in that directory encourages developers to supply a path, which triggers the error.
Move or copy the compiled UDF library (*.so on Linux, *.dll on Windows) into the directory returned by SHOW VARIABLES LIKE 'plugin_dir';
.
Re-run CREATE FUNCTION
or INSTALL SONAME
using only the file name.
Restart the server if plugin_dir
was changed in my.cnf
.
Linux absolute path supplied – Copy my_udf.so
to /usr/lib/mysql/plugin
then execute CREATE FUNCTION my_udf RETURNS INT SONAME 'my_udf.so';
.
Windows drive letter path – Place my_udf.dll
in the plugin directory shown by SHOW VARIABLES
and recreate the function.
Keep a dedicated build pipeline that outputs UDF binaries directly to the server’s plugin directory.
Automate validation scripts that block commits containing paths in CREATE FUNCTION ...
SONAME
.
ER_UDF_EXISTS (1125)
– Function already defined. Use DROP FUNCTION
first.
ER_CANT_OPEN_LIBRARY (1126)
– File not found or missing permissions. Verify library ownership and placement in plugin_dir
.
.
No. MySQL only loads shared libraries placed inside plugin_dir
. Supplying a path causes Error 1124.
Run SHOW VARIABLES LIKE 'plugin_dir';
. The default is often /usr/lib/mysql/plugin
on Linux.
No restart is needed if plugin_dir
is unchanged. You only need to run the CREATE FUNCTION
or INSTALL SONAME
again.
Galaxy’s SQL editor warns when a path is typed in CREATE FUNCTION ... SONAME
and links directly to this guide, preventing the error before execution.