Common SQL Errors

MySQL Error 25: EE_CANT_SYMLINK - How to Fix and Prevent

Galaxy Team
August 5, 2025

MySQL error 25 EE_CANT_SYMLINK appears when the server cannot create the requested symbolic link because the operating system or filesystem blocks symlinks, the target path is invalid, or MySQL lacks permissions.

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 25 EE_CANT_SYMLINK?

MySQL Error 25 EE_CANT_SYMLINK occurs when the server fails to create a symbolic link to a data or log file. Fix it by enabling symlink support in your OS, granting the MySQL service write and create-symlink privileges, or launching the server with the --skip-symbolic-links option to bypass symlink creation.

Error Highlights

Typical Error Message

Can't create symlink '%s' pointing at '%s' (Error %d - %s)

Error Type

Filesystem Error

Language

MySQL

Symbol

EE_CANT_SYMLINK

Error Code

25

SQL State

Explanation

Table of Contents

What is MySQL error 25 EE_CANT_SYMLINK?

The message "Can't create symlink '%s' pointing at '%s' (Error %d - %s)" signals that MySQL tried to create a filesystem symbolic link and the operation failed. The server aborts the current DDL or startup step to avoid corrupting data.

Symlinks let MySQL store table files outside the data directory or alias log destinations.

If the host OS forbids symlinks, or the MySQL user lacks privileges, the creation attempt triggers error 25.

What Causes This Error?

Operating systems such as Windows or hardened Linux distributions may disable symlink creation by default. MySQL then throws EE_CANT_SYMLINK during CREATE TABLE, ALTER TABLE, or server start when it builds the .frm or .ibd link to the real path.

Invalid target paths, missing parent directories, or SELinux/AppArmor profiles that block the symlink syscall also raise the error.

Cross-filesystem links can fail when the mount option nosymfollow is active.

How to Fix MySQL Error 25 EE_CANT_SYMLINK

First, confirm the underlying OS error with SHOW WARNINGS or the server error log. Grant the MySQL user write and create symlink capabilities on the source and target directories.

On Linux, run sudo setcap cap_dac_override,cap_sys_admin+ep $(which mysqld) or add the user to a policy allowing symlink.

If your security policy prohibits symlinks, disable the feature in MySQL by adding skip-symbolic-links to my.cnf or start with --skip-symbolic-links.

For Windows, ensure the service runs as an account with "Create symbolic links" rights or use mklink to pre-create the link.

Common Scenarios and Solutions

Create or alter table on a different disk: enable symlinks, verify that the target path exists, then rerun the DDL. Server fails to start after datadir move: update datadir paths, pre-create required links, or launch with skip-symbolic-links.

SELinux blocking: set setsebool -P mysql_connect_any 1 or craft a custom policy permitting symlink.

AppArmor: add /var/lib/mysql/** mrwkl, to the profile and reload.

Best Practices to Avoid This Error

Keep data and log files inside the MySQL data directory when possible, eliminating symlink needs.

If external paths are required, test symlink creation during staging and document required OS privileges.

Automate configuration checks with CI scripts or Galaxy’s pre-flight linter, which flags disallowed filesystem operations before deployment.

Related Errors and Solutions

Error 13 (Permission denied) appears when the link target exists but MySQL lacks rights. Error 1 (Operation not permitted) often accompanies hardened kernels with nosymfollow. Both resolve with the same privilege adjustments outlined above.

.

Common Causes

Symlink Creation Disabled

The operating system or container runtime disallows symbolic links for security, leading MySQL to raise EE_CANT_SYMLINK when it tries to create one.

Insufficient OS Permissions

The account running mysqld lacks the Create symbolic links privilege (Windows) or the CAP_DAC_OVERRIDE capability (Linux).

Invalid Target Path

The destination file or directory referenced in CREATE TABLE or server configuration does not exist or is on a read-only mount.

Mandatory Access Controls

SELinux or AppArmor profiles block the symlink syscall for the mysqld process, triggering the error even when filesystem permissions are correct.

.

Related Errors

FAQs

Can I ignore MySQL error 25?

You can bypass it with --skip-symbolic-links, but ignoring the root cause may hide storage misconfiguration.

Does Windows support MySQL symlinks?

Yes, but the service account must have the "Create symbolic links" right or run as Administrator.

Is using symlinks safe for production?

Symlinks are safe if managed carefully; ensure backups follow links and OS policies allow them.

How does Galaxy help?

Galaxy’s pre-flight checks detect DATA DIRECTORY clauses and flag potential symlink issues before execution, saving debugging time.

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