博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu mysql INTO FILE 权限问题
阅读量:4604 次
发布时间:2019-06-09

本文共 1520 字,大约阅读时间需要 5 分钟。

SELECT * FROM customer INTO OUTFILE '/db_backups'

问题:ERROR 1 (HY000): Can't create/write to file 'db_backups' (Errcode: 13)

1。可能权限不够:chmod 1777 *** 

  【***是要更改权限的文件目录】

     试一下上面的命令时候还是报错。要是还是报错就是说明ubuntu限制了mysql。执行下面2中的配置。

2.

Which particular version of Ubuntu is this and is this Ubuntu Server Edition?

Recent Ubuntu Server Editions (such as 10.04) ship with AppArmor and MySQL's profile might be in enforcing mode by default. You can check this by executing sudo aa-status like so:

# sudo aa-status  5 profiles are loaded.  5 profiles are in enforce mode.     /usr/lib/connman/scripts/dhclient-script     /sbin/dhclient3     /usr/sbin/tcpdump     /usr/lib/NetworkManager/nm-dhcp-client.action     /usr/sbin/mysqld  要是有这个表示mysql被限制了执行下面绿色的命令 0 profiles are in complain mode.  1 processes have profiles defined.  1 processes are in enforce mode :     /usr/sbin/mysqld (1089)  0 processes are in complain mode. 

If mysqld is included in enforce mode, then it is the one probably denying the write. Entries would also be written in /var/log/messages when AppArmor blocks the writes/accesses. What you can do is edit /etc/apparmor.d/usr.sbin.mysqld and add /data/ and /data/* near the bottom like so:

...

/usr/sbin/mysqld {
    ...
    /var/log/mysql/ r,
    /var/log/mysql/* rw,
    /var/run/mysqld/mysqld.pid w,
    /var/run/mysqld/mysqld.sock w,
    /data/ r,  添加要生成文件的路径
    /data/* rw,添加要生成文件的路径
}

And then make AppArmor reload the profiles.

# sudo /etc/init.d/apparmor reload 原文出处:

转载于:https://www.cnblogs.com/liangxw1987/archive/2012/12/09/2809839.html

你可能感兴趣的文章
行为型模式:中介者模式
查看>>
How to Notify Command to evaluate in mvvmlight
查看>>
33. Search in Rotated Sorted Array
查看>>
461. Hamming Distance
查看>>
Python垃圾回收机制详解
查看>>
jquery 编程的最佳实践
查看>>
MeetMe
查看>>
IP报文格式及各字段意义
查看>>
(转载)rabbitmq与springboot的安装与集成
查看>>
C2. Power Transmission (Hard Edition)(线段相交)
查看>>
STM32F0使用LL库实现SHT70通讯
查看>>
Atitit. Xss 漏洞的原理and应用xss木马
查看>>
MySQL源码 数据结构array
查看>>
(文件过多时)删除目录下全部文件
查看>>
T-SQL函数总结
查看>>
python 序列:列表
查看>>
web移动端
查看>>
pythonchallenge闯关 第13题
查看>>
linux上很方便的上传下载文件工具rz和sz使用介绍
查看>>
React之特点及常见用法
查看>>