找回密码
 创建账号
打印 上一主题 下一主题

Run mysql as a normal user 以普通用户运行 mysql 服务

跳转到指定楼层
1#
php 发表于 2021/3/29 16:23 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[ERROR] InnoDB: Unable to create temporary file; errno: 0
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Failed to initialize builtin plugins.
[ERROR] Aborting

[ERROR] InnoDB: GetDiskFreeSpace(C:\,...) failed - OS error number 5
[ERROR] InnoDB: os_file_get_status() failed on '.\ibdata1'. Can't determine file permissions
[ERROR] InnoDB: Plugin initialization aborted with error Generic error
[ERROR] Plugin 'InnoDB' init function returned error.
[ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
[ERROR] Failed to initialize builtin plugins.
[ERROR] Aborting

To run the mysql (service) as a normal user under Windows systems, you should pay more attention to the NTFS permissions.
System 账号权限太高,想要在 Windows 中以普通用户的身份运行 mysql (服务),必须给这个运行 mysql 的用户必要的权限。

Firstly, configure mysql's datadir and tmpdir directive in mysql's configuration file, like首先,在 mysql 的配置文件中设置数据目录和临时文件夹路径,如果不设置,数据目录的默认值为 mysql 程序文件夹的 data 子目录,临时文件夹默认路径为 C:\windows\Temp,为了避免权限问题,建议用绝对路径指定这两个文件夹。
  1. datadir=C:/wuxiancheng.cn/mysql/data
复制代码
  1. tmpdir="C:/wuxiancheng.cn/mysql/tmp"
复制代码
The user account that runs mysql must have READ and EXECUTE permissions to mysql's containing folder and subfolders.
运行 mysql 的用户必须拥有 mysql 程序文件夹及其子目录的读取和执行权限。
  1. icacls C:\wuxiancheng.cn\mysql /grant:r wuxiancheng:(OI)(CI)(RX) /c /t
复制代码
The user account that runs mysql must have WRITE permission to the data directory and the temporary data directory of mysql.
运行 mysql 的用户必须拥有 mysql 数据目录和临时文件夹的写入权限
  1. icacls C:\wuxiancheng.cn\mysql\data /grant:r wuxiancheng:(OI)(CI)(M) /c /t
复制代码
  1. icacls C:\wuxiancheng.cn\mysql\tmp /grant:r wuxiancheng:(OI)(CI)(M) /c /t
复制代码
The user account that runs mysql must have READ permission to the root directory of the disk partition where the data directories resides in as mysql will calculate the free space of that disk partition while getting itself started.
最后,也是最重要的一点,运行 mysql 的用户必须拥有 mysql 所在磁盘分区最顶级目录的读取权限,因为 mysql 需要统计磁盘剩余空间,如果没有权限,会导致 GetDiskFreeSpace() 失败,从而导致 mysql 无法启动。
  1. icacls C:\ /grant:r wuxiancheng:(R)
复制代码

轻松E站

轻松E站

快速回复 返回顶部 返回列表
百度