Common SQL Errors

MySQL Error 1124: ER_UDF_NO_PATHS – No paths allowed for shared library

Galaxy Team
August 5, 2025

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.

Sign up for the latest in common SQL errors from the Galaxy Team!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

What is MySQL error 1124 ER_UDF_NO_PATHS?

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.

Error Highlights

Typical Error Message

No paths allowed for shared library

Error Type

User-Defined Function Error

Language

MySQL

Symbol

ER_UDF_NO_PATHS

Error Code

1124

SQL State

Explanation

Table of Contents

What is MySQL Error 1124 (ER_UDF_NO_PATHS)?

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.

When Does This Error Occur?

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.

What Causes This Error?

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.

How to Fix MySQL Error 1124

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.

Common Scenarios and Solutions

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.

Best Practices to Avoid This Error

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.

Related Errors and Solutions

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.

.

Common Causes

Related Errors

FAQs

Can I load a UDF from any directory?

No. MySQL only loads shared libraries placed inside plugin_dir. Supplying a path causes Error 1124.

Where is plugin_dir located?

Run SHOW VARIABLES LIKE 'plugin_dir';. The default is often /usr/lib/mysql/plugin on Linux.

Do I need to restart MySQL after copying the library?

No restart is needed if plugin_dir is unchanged. You only need to run the CREATE FUNCTION or INSTALL SONAME again.

How does Galaxy help?

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.

Start Querying with the Modern SQL Editor Today!
Welcome to the Galaxy, Guardian!
You'll be receiving a confirmation email

Follow us on twitter :)
Oops! Something went wrong while submitting the form.

Check out some other errors

Trusted by top engineers on high-velocity teams
Aryeo Logo
Assort Health
Curri
Rubie Logo
Bauhealth Logo
Truvideo Logo