首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法启用Mysql的符号链接

无法启用Mysql的符号链接
EN

Stack Overflow用户
提问于 2017-12-31 11:36:47
回答 2查看 3.4K关注 0票数 5

我在Windows 7上使用Mysql版本: 10.1.21-MariaDB,当我运行flollowing命令SHOW VARIABLES LIKE 'have_symlink';时,我得到:

代码语言:javascript
复制
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_symlink  | NO    |
+---------------+-------+

所以我想让他们。我试过什么?

  • 运行:mysql --symbolic-links会产生以下错误: mysql: unknown option '--symbolic-links'
  • 我搜索了配置文件可能存在的位置,因此在以下位置查找my.cnfmy.ini%WINDIR%\my.ini %WINDIR%\my.cnf \my.ini \my.cnf %APPDIR%\mysql\my.ini %APPDIR%\mysql\my.cnf %APPDIR%\mysql\data\my.ini %APPDIR%\mysql\data\my.cnf,然后创建了以下选项文件,以便在启动服务器my.cnf时使用以下命令: [mysqld] symbolic-links
  • 我有确保在Windows中

启用了本地到本地符号链接。 启用了本地到远程符号链接。

那么,我做错了什么,如何使have_symlink变量具有yes的值?

编辑:我在更改my.cnf文件后重新启动了服务器,但没有成功

编辑2:对于第一个提到的错误,是因为--symbolic-link是服务器而不是客户端选项,所以我会键入mysqld --symbolic-links,这可以帮助我搜索任何选项文件,因为命令行指定的选项优先。

EN

回答 2

Stack Overflow用户

发布于 2017-12-31 11:41:34

你必须做两件事:

  1. symbolic-links=1放在[mysqld]下的配置文件symbolic-links=1中。
  2. 重新启动MySQL服务器。

重新启动后,have_symlink值应该是yes

警告:建议禁用符号链接的以防止各种安全风险(参考文献)。

票数 6
EN

Stack Overflow用户

发布于 2022-10-20 11:36:40

您似乎正在运行MySQL 10。

符号链接在MySQL 8中不再受欢迎。

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

代码语言:javascript
复制
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.
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48042107

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档