• <legend id='rkj8r'><style id='rkj8r'><dir id='rkj8r'><q id='rkj8r'></q></dir></style></legend>

    <tfoot id='rkj8r'></tfoot>
      <bdo id='rkj8r'></bdo><ul id='rkj8r'></ul>

        <i id='rkj8r'><tr id='rkj8r'><dt id='rkj8r'><q id='rkj8r'><span id='rkj8r'><b id='rkj8r'><form id='rkj8r'><ins id='rkj8r'></ins><ul id='rkj8r'></ul><sub id='rkj8r'></sub></form><legend id='rkj8r'></legend><bdo id='rkj8r'><pre id='rkj8r'><center id='rkj8r'></center></pre></bdo></b><th id='rkj8r'></th></span></q></dt></tr></i><div id='rkj8r'><tfoot id='rkj8r'></tfoot><dl id='rkj8r'><fieldset id='rkj8r'></fieldset></dl></div>
      1. <small id='rkj8r'></small><noframes id='rkj8r'>

      2. 加载数据文件错误代码:13

        LOAD DATA INFILE Error Code : 13(加载数据文件错误代码:13)
          <tbody id='W7RHP'></tbody>

        <small id='W7RHP'></small><noframes id='W7RHP'>

          1. <legend id='W7RHP'><style id='W7RHP'><dir id='W7RHP'><q id='W7RHP'></q></dir></style></legend>

                <bdo id='W7RHP'></bdo><ul id='W7RHP'></ul>
                • <tfoot id='W7RHP'></tfoot>
                  <i id='W7RHP'><tr id='W7RHP'><dt id='W7RHP'><q id='W7RHP'><span id='W7RHP'><b id='W7RHP'><form id='W7RHP'><ins id='W7RHP'></ins><ul id='W7RHP'></ul><sub id='W7RHP'></sub></form><legend id='W7RHP'></legend><bdo id='W7RHP'><pre id='W7RHP'><center id='W7RHP'></center></pre></bdo></b><th id='W7RHP'></th></span></q></dt></tr></i><div id='W7RHP'><tfoot id='W7RHP'></tfoot><dl id='W7RHP'><fieldset id='W7RHP'></fieldset></dl></div>

                  本文介绍了加载数据文件错误代码:13的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  在我的远程 MySQL 中,当我尝试执行此查询时,我收到 MySQL 错误代码:13.

                  In my remote MySQL, when I try to execute this query, I am getting the MySQL Error Code : 13.

                  查询 -

                  LOAD DATA INFILE 
                  '/httpdocs/.../.../testFile.csv'
                  INTO TABLE table_temp
                  FIELDS TERMINATED BY ','
                  LINES TERMINATED BY '\\r \\n'
                  (sku, qty);
                  

                  错误代码:13 Can't get stat of '/httpdocs/.../.../testFile.csv' (Errcode: 2)

                  一个.数据库用户登录具有所有授予权限.

                  a. The database userlogin has all the grant priviliges.

                  CREATE USER 'userName'@'%' IDENTIFIED BY '************';
                  
                  GRANT ALL PRIVILEGES ON * . * TO 'userName'@'%' IDENTIFIED BY '************' WITH GRANT OPTION MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;
                  
                  GRANT ALL PRIVILEGES ON `userName\_%` . * TO 'userName'@'%';
                  

                  B.我还将文件和文件夹权限设置为 chmod 777 (rwxrwxrwx)使用FTP工具

                  b. I have also set the file and folder permission to chmod 777 (rwxrwxrwx) using FTP Tool

                  推荐答案

                  我知道这个帖子很旧,但是搜索结果中仍然出现这个.我在网上找不到这个问题的解决方案,所以我最终自己解决了这个问题.如果您使用的是 Ubuntu,那么有一个名为Apparmor"的程序会阻止 MySQL 看到该文件.如果您希望 MySQL 能够从tmp"目录读取文件,您需要执行以下操作:

                  I know that this post is old, but this still comes up in search results. I couldn't find the solution to this problem online, so I ended up figuring it out myself. If you're using Ubuntu, then there is a program called "Apparmor" that is preventing MySQL from seeing the file. Here's what you need to do if you want MySQL to be able to read files from the "tmp" directory:

                  sudo vim /etc/apparmor.d/usr.sbin.mysqld
                  

                  进入文件后,您将看到一堆 MySQL 可以使用的目录.将行 /tmp/** rwk 添加到文件中(我不确定它放在哪里很重要,但这里是我放置它的位置的示例):

                  Once you are in the file, you're going to see a bunch of directories that MySQL can use. Add the line /tmp/** rwk to the file (I am not sure that it matters where, but here is a sample of where I put it):

                    /etc/mysql/*.pem r,
                  
                    /etc/mysql/conf.d/ r,
                  
                    /etc/mysql/conf.d/* r,
                  
                    /etc/mysql/*.cnf r,
                  
                    /usr/lib/mysql/plugin/ r,
                  
                    /usr/lib/mysql/plugin/*.so* mr,
                  
                    /usr/sbin/mysqld mr,
                  
                    /usr/share/mysql/** r,
                  
                    /var/log/mysql.log rw,
                  
                    /var/log/mysql.err rw,
                  
                    /var/lib/mysql/ r,
                  
                    /var/lib/mysql/** rwk,
                  
                  
                    /tmp/** rwk,
                  
                  
                    /var/log/mysql/ r,
                  
                    /var/log/mysql/* rw,
                  
                    /var/run/mysqld/mysqld.pid w,
                  
                    /var/run/mysqld/mysqld.sock w,
                  
                    /run/mysqld/mysqld.pid w,
                  
                    /run/mysqld/mysqld.sock w,
                  

                  现在您需要做的就是重新加载 Apparmor:

                  Now all you need to do is reload Apparmor:

                  sudo /etc/init.d/apparmor reload
                  

                  请注意,我使用了vim",但可以将其替换为您最喜欢的、您知道如何使用的文本编辑器.

                  Note I used "vim", but substitute that with whatever your favorite text editor is that you know how to use.

                  这篇关于加载数据文件错误代码:13的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Bogus foreign key constraint fail(虚假外键约束失败)
                  how to get last insert id after insert query in codeigniter active record(如何在codeigniter活动记录中插入查询后获取最后一个插入ID)
                  Force InnoDB to recheck foreign keys on a table/tables?(强制 InnoDB 重新检查表/表上的外键?)
                  How to auto generate migrations with Sequelize CLI from Sequelize models?(如何使用 Sequelize CLI 从 Sequelize 模型自动生成迁移?)
                  Clear MySQL query cache without restarting server(无需重启服务器即可清除 MySQL 查询缓存)
                  ALTER TABLE to add a composite primary key(ALTER TABLE 添加复合主键)

                  • <bdo id='UEv1q'></bdo><ul id='UEv1q'></ul>
                      1. <legend id='UEv1q'><style id='UEv1q'><dir id='UEv1q'><q id='UEv1q'></q></dir></style></legend>
                        <i id='UEv1q'><tr id='UEv1q'><dt id='UEv1q'><q id='UEv1q'><span id='UEv1q'><b id='UEv1q'><form id='UEv1q'><ins id='UEv1q'></ins><ul id='UEv1q'></ul><sub id='UEv1q'></sub></form><legend id='UEv1q'></legend><bdo id='UEv1q'><pre id='UEv1q'><center id='UEv1q'></center></pre></bdo></b><th id='UEv1q'></th></span></q></dt></tr></i><div id='UEv1q'><tfoot id='UEv1q'></tfoot><dl id='UEv1q'><fieldset id='UEv1q'></fieldset></dl></div>
                      2. <tfoot id='UEv1q'></tfoot>

                          <tbody id='UEv1q'></tbody>

                          <small id='UEv1q'></small><noframes id='UEv1q'>