zoukankan      html  css  js  c++  java
  • ubuntu 12.04 mysql 错误 Errcode 13

    mysql> select * into outfile '/home/angelmylove/mysql/student.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from student limit 100;
    ERROR 1 (HY000): Can't create/write to file '/home/angelmylove/mysql/student.txt' (Errcode: 13)

    1,chmod -R 777 文件位置

    2,

    # 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,
        /文件路径/ r,  添加要生成文件的路径
        /文件路径/* rw,添加要生成文件的路径

    //重新加载

    # sudo /etc/init.d/apparmor reload 

    mysql> select * into outfile '/home/angelmylove/mysql/student.txt' fields terminated by ',' optionally enclosed by '"' lines terminated by '\n' from student limit 100;
    Query OK, 0 rows affected (0.00 sec)



    }

  • 相关阅读:
    创建者模式 -- 单例模式(反射&序列化)
    设计模式(总)
    并不是static final 修饰的变量都是编译期常量
    内部类和静态内部类的加载顺序
    所有的Java虚拟机必须实现在每个类或接口被Java程序 “ 首次主动使用 ” 时才初始化他们
    24 shell 管道命令与过滤器
    26 bash shell中的信号
    25 Linux中的信号
    23 shell 进程替换
    22 shell组命令与子进程
  • 原文地址:https://www.cnblogs.com/zhangjun516/p/2869792.html
Copyright © 2011-2022 走看看