mysql - MySQL 不允许写入文件系统
问题描述
我在我的 Ubuntu 机器上运行 MariaDB 服务器mysql Ver 15.1 Distrib 10.1.44-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2
。尝试在自定义数据目录中创建新表时DATA DIRECTORY='/home/myuser/ext'
,MySQL 错误日志告诉我
7f70acb77700 InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
mysqld 以 mysql 用户身份运行:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
30450 mysql 20 0 695572 206208 16432 S 0,0 1,3 0:43.48 mysqld
数据目录归mysql用户所有:
$ ls -l
drwxr-xr-x 4 mysql mysql 4096 Feb 13 11:16 ext
原始数据目录的所有权和权限:
$ ll /var/lib/mysql/
total 1355856
drwxr-xr-x 7 mysql mysql 4096 Feb 13 12:00 ./
apparmor 显然没有干扰。内容/etc/apparmor.d/usr.sbin.mysqld
# This file is intensionally empty to disable apparmor by default for newer
# versions of MariaDB, while providing seamless upgrade from older versions
# and from mysql, where apparmor is used.
#
# By default, we do not want to have any apparmor profile for the MariaDB
# server. It does not provide much useful functionality/security, and causes
# several problems for users who often are not even aware that apparmor
# exists and runs on their system.
#
# Users can modify and maintain their own profile, and in this case it will
# be used.
#
# When upgrading from previous version, users who modified the profile
# will be promptet to keep or discard it, while for default installs
# we will automatically disable the profile.
/etc/apparmor.d/local/usr.sbin.mysqld
不存在。
我在这里没有想法......还能是什么?
解决方案
推荐阅读
- c++ - 如何通过组合红色和蓝色无符号字节来优化混合?
- python - Pytorch 简单模型没有改进
- c - 如何让函数将值返回给全局变量(我认为是范围问题)?
- c# - 2d 平台游戏石头改变大小
- web-services - Maximo:通过单击 URL 更改工作订单状态
- .htaccess - 重写没有 php 扩展的友好 url
- pyspark - 在新列下的pyspark数据框中存储多个列的值
- listview - 在 Flutter 中构建动态列表最有效的方法是什么?
- java - 如何停止我的代码在方法内运行而不给出想要的返回
- python - 如何将拟合参数从一个 sklearn 管道步骤传递到另一个?