user10089632
user10089632

Reputation: 5550

Couldn't enable symbolic links for Mysql

I'm using the Mysql Server version: 10.1.21-MariaDB on Windows 7, and when I run the flollowing command SHOW VARIABLES LIKE 'have_symlink'; I get :

+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_symlink  | NO    |
+---------------+-------+

So I want to enable them. What have I tried ?

Local to local symbolic links are enabled.
Local to remote symbolic links are enabled.

So what am I doing wrong and how to make the have_symlink variable have a value of yes ??

EDIT: I've restarted the server after the change to the my.cnf file, but without success

EDIT 2: for the first mentioned error, it is because --symbolic-link is a server rather than client option, so I would type mysqld --symbolic-links and that relieves me of searching any option file, because the command line specified options take precedence.

Upvotes: 5

Views: 5693

Answers (2)

Graham Leach
Graham Leach

Reputation: 25

You appear to be running MySQL 10

symbolic-links is deprecated as of MySQL 8

https://dev.mysql.com/worklog/task/?id=8392

Symbolic links is defacto disabled on most MySQL distributions, because sample 
configuration files contain:

symbolic-links=0

Since symbolic links allow MySQL to write data to any effective location on the
operating system, it creates two issues:

1) MySQL may be tricked into writing to locations it is not supposed to
2) MySQL may write to a location that has privileges that are too loose, and may 
be tampered with by other users on the operating system.

(MySQL mitigates risk #1 by not overwriting existing files, but the risk still 
remains as an attack vector.)

We therefore decided:

1) Change the compiled default to OFF (aligning with the defacto default)
2) Deprecate and remove this functionality in a future release.

Deprecation of --symbolic-links includes deprecating have_symlink.

Upvotes: 0

Angel Politis
Angel Politis

Reputation: 11313

You've got to do two things:

  1. Put symbolic-links=1 in the configuration file (.cnf) under [mysqld].
  2. Restart the MySQL Server.

After restarting, the have_symlink value should be yes.


Beware: Disabling symbolic-links is recommended to prevent assorted security risks (reference).

Upvotes: 6

Related Questions