无法使用“MariaDB” Windows 用户/组帐户为 MariaDB 提供访问数据文件夹权限。

huangapple go评论59阅读模式
英文:

Can't Use "MariaDB" Windows User/Group Account To Give MariaDB Permission To Access Data Folder

问题

我正在尝试升级我的老旧的10.3 MariaDB数据库,并按照卸载旧版本、安装新版本(10.6)并将所需的数据和ini文件复制到新文件夹位置的指南步骤进行操作;将先前10.3安装文件夹中的"data"文件夹复制到新的10.6安装文件夹。

随后,新的MariaDB实例无法访问此数据文件夹,因为存在文件夹权限问题。

在比较复制的"data"文件夹权限与10.6安装创建的原始"data"文件夹之间的差异时,我发现列表中列出了一个名为"MariaDB"的条目,属于组和用户名。奇怪的是,我无法找到,更不用说添加这个用户/组到我从旧的10.3位置复制过来的"data"文件夹中。

这个Windows用户组是什么?
我无法找到MariaDB或任何指南在哪里找到或添加这个用户组。
我唯一找到的提及是在https://stackoverflow.com/a/69981074/9162516 中

...这个"组用户"在Windows的"用户和组"下没有被创建。
因此,您不能在安全选项卡上添加此组并设置权限到
另一个文件夹。

该死!我应该如何为来自旧版本的数据文件夹分配权限,或者如果我想从没有在该文件夹及其内容上设置该用户组权限的外部来源复制文件夹,该怎么办?
谷歌搜索结果将我发送到与创建MariaDB数据库用户帐户无关的指南。

英文:

I am trying to upgrade my aging 10.3 MariaDB database and have followed the guide steps of uninstalling the old version, installing the new version (10.6) and copying the needed data and ini files to the new folder location; Copying the "data" folder from the previous 10.3 installation folder to the new 10.6 installation folder.
Subsequently, the new instance of MariaDB isn't able to access this data folder due to folder permissions.

Checking on the differences between the copied "data" folder permissions and the original "data" folder that was created by the 10.6 installation, I find there is an entry listed as "MariaDB" in the list of Group and user names. The strange thing is, I can't find, let alone add, this user/group to the "data" folder that I'm copying over from my old 10.3 location.

What is this Windows user group?
I am not able to find any documentation by MariaDB or any guides where to find or add this user group.
The only mention I found of this is in https://stackoverflow.com/a/69981074/9162516

> ... this "group user" is not create under Windows "users and groups".
> So you cannot add this group on security tab and set permission to
> another folder.

What the hell? How am I supposed to assign the permissions to the data folder from an older version or if I want to copy the folder from an external source that doesn't have that user group permission already set on that folder and its contents?

Google search results is sending me unrelated guides creating MariaDB database user accounts.

答案1

得分: 1

在Windows上没有MariaDB用户或组,从来没有。服务在10.6版本下以所谓的服务帐户NT SERVICE\servicename用户运行。在早期版本中,服务以"NETWORK SERVICE"身份运行。

(检查方法很简单,运行services.msc => 找到您的服务名称 => 右键"属性" => 登录)

运行该服务的用户需要对数据目录中的文件拥有完全访问权限。如何授予权限,可以使用命令行工具如icacls,或者在资源管理器中点击操作,取决于您。

现在,如果您在10.6版本中没有删除数据目录,而只是复制了旧数据目录的内容,那么一切都没问题。因为在Windows上,权限是从父目录继承的,它们已经是正确的了。

英文:

There is no MariaDB user or group on Windows, never was. The service is running under so-called service-account NT SERVICE\servicename user, in 10.6 . The service is running under "NETWORK SERVICE" in the older versions.

(It is not hard to check, Run services.msc => find name your service => right "Properties" => Log On)

That user, that runs the service, needs full access to files in data directory. How do you you grant permissions, either with command-line tools like icacls, or clicking in Explorer, is up to you.

Now, if you did not remove the data directory in 10.6, and just copied the contents of your old datadir, you'd be fine. That's because on Windows, the permissions are inherited from parent directory, and they were correct already.

huangapple
  • 本文由 发表于 2023年1月9日 06:29:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75051716.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定