Unix permission to load a csv file into MySQL












0















I am having problems trying to load my .csv file into MySQL on my Centos box. My file is called 'OD_Orders.csv' is located in my home directory called /home/kam/KamSQLData



The error I get when I tried to load up the file into MySQL is:



mysql> LOAD DATA LOCAL INFILE '/home/kam/KamSQLData/OD_Orders.csv' INTO TABLE orders FIELDS TERMINATED BY ',' LINES TERMINATED BY 'n';
ERROR 13 (HY000): File '/home/kam/KamSQLData/OD_Orders.csv' not found (Errcode: 13)



I did some reading and the usual culprit is Unix permissions are off or wrong. I than proceed to create a group (called KamSQLData) so the userid of 'mysql' and 'kam' can share the group on /home/kam/KamSQLData:



KamSQLData:x:512:mysql,kam



I then proceed to set /home/kam/KamSQLData as the group of 'KamSQLData', thinking both kam and mysql will have access to it.




-rwxr-xrwx. 1 root KamSQLData 2322 Feb 15 14:03 OD_Orders_2019-01-28.csv
-rwxr-xrwx. 1 root KamSQLData 5282 Feb 15 14:03 OD_Orders_2019-01-25.csv
-rwxr-xrwx. 1 root KamSQLData 4428 Feb 15 14:03 OD_Orders_2019-01-24.csv
-rwxr-xrwx. 1 root KamSQLData 9784 Feb 15 14:03 OD_Orders_2019-01-23.csv
-rwxr-xrwx. 1 root KamSQLData 3795 Feb 15 14:03 OD_Orders_2019-01-22.csv
-rwxr-xrwx. 1 root KamSQLData 11004 Feb 15 14:03 OD_Orders_2019-01-18.csv
-rwxr-xrwx. 1 root KamSQLData 3528 Feb 15 14:03 OD_Orders_2019-01-17.csv
-rwxr-xrwx. 1 root KamSQLData 5655 Feb 15 14:03 OD_Orders_2019-01-16.csv
-rwxr-xrwx. 1 root KamSQLData 2959 Feb 15 14:03 OD_Orders_2019-01-15.csv
-rwxr-xrwx. 1 kam KamSQLData 27084955 Feb 15 14:21 OD_Orders.csv
drwx------. 12 kam kam 4096 Feb 15 14:21 ..
drwxr-srwx. 2 root KamSQLData 20480 Feb 15 14:36 .


Than i went ahead and set the following to my directory:



sudo chmod -R 2775 /home/kam/KamSQLData/










share|improve this question

























  • Comments are not for extended discussion; this conversation has been moved to chat.

    – terdon
    Feb 20 at 17:43
















0















I am having problems trying to load my .csv file into MySQL on my Centos box. My file is called 'OD_Orders.csv' is located in my home directory called /home/kam/KamSQLData



The error I get when I tried to load up the file into MySQL is:



mysql> LOAD DATA LOCAL INFILE '/home/kam/KamSQLData/OD_Orders.csv' INTO TABLE orders FIELDS TERMINATED BY ',' LINES TERMINATED BY 'n';
ERROR 13 (HY000): File '/home/kam/KamSQLData/OD_Orders.csv' not found (Errcode: 13)



I did some reading and the usual culprit is Unix permissions are off or wrong. I than proceed to create a group (called KamSQLData) so the userid of 'mysql' and 'kam' can share the group on /home/kam/KamSQLData:



KamSQLData:x:512:mysql,kam



I then proceed to set /home/kam/KamSQLData as the group of 'KamSQLData', thinking both kam and mysql will have access to it.




-rwxr-xrwx. 1 root KamSQLData 2322 Feb 15 14:03 OD_Orders_2019-01-28.csv
-rwxr-xrwx. 1 root KamSQLData 5282 Feb 15 14:03 OD_Orders_2019-01-25.csv
-rwxr-xrwx. 1 root KamSQLData 4428 Feb 15 14:03 OD_Orders_2019-01-24.csv
-rwxr-xrwx. 1 root KamSQLData 9784 Feb 15 14:03 OD_Orders_2019-01-23.csv
-rwxr-xrwx. 1 root KamSQLData 3795 Feb 15 14:03 OD_Orders_2019-01-22.csv
-rwxr-xrwx. 1 root KamSQLData 11004 Feb 15 14:03 OD_Orders_2019-01-18.csv
-rwxr-xrwx. 1 root KamSQLData 3528 Feb 15 14:03 OD_Orders_2019-01-17.csv
-rwxr-xrwx. 1 root KamSQLData 5655 Feb 15 14:03 OD_Orders_2019-01-16.csv
-rwxr-xrwx. 1 root KamSQLData 2959 Feb 15 14:03 OD_Orders_2019-01-15.csv
-rwxr-xrwx. 1 kam KamSQLData 27084955 Feb 15 14:21 OD_Orders.csv
drwx------. 12 kam kam 4096 Feb 15 14:21 ..
drwxr-srwx. 2 root KamSQLData 20480 Feb 15 14:36 .


Than i went ahead and set the following to my directory:



sudo chmod -R 2775 /home/kam/KamSQLData/










share|improve this question

























  • Comments are not for extended discussion; this conversation has been moved to chat.

    – terdon
    Feb 20 at 17:43














0












0








0








I am having problems trying to load my .csv file into MySQL on my Centos box. My file is called 'OD_Orders.csv' is located in my home directory called /home/kam/KamSQLData



The error I get when I tried to load up the file into MySQL is:



mysql> LOAD DATA LOCAL INFILE '/home/kam/KamSQLData/OD_Orders.csv' INTO TABLE orders FIELDS TERMINATED BY ',' LINES TERMINATED BY 'n';
ERROR 13 (HY000): File '/home/kam/KamSQLData/OD_Orders.csv' not found (Errcode: 13)



I did some reading and the usual culprit is Unix permissions are off or wrong. I than proceed to create a group (called KamSQLData) so the userid of 'mysql' and 'kam' can share the group on /home/kam/KamSQLData:



KamSQLData:x:512:mysql,kam



I then proceed to set /home/kam/KamSQLData as the group of 'KamSQLData', thinking both kam and mysql will have access to it.




-rwxr-xrwx. 1 root KamSQLData 2322 Feb 15 14:03 OD_Orders_2019-01-28.csv
-rwxr-xrwx. 1 root KamSQLData 5282 Feb 15 14:03 OD_Orders_2019-01-25.csv
-rwxr-xrwx. 1 root KamSQLData 4428 Feb 15 14:03 OD_Orders_2019-01-24.csv
-rwxr-xrwx. 1 root KamSQLData 9784 Feb 15 14:03 OD_Orders_2019-01-23.csv
-rwxr-xrwx. 1 root KamSQLData 3795 Feb 15 14:03 OD_Orders_2019-01-22.csv
-rwxr-xrwx. 1 root KamSQLData 11004 Feb 15 14:03 OD_Orders_2019-01-18.csv
-rwxr-xrwx. 1 root KamSQLData 3528 Feb 15 14:03 OD_Orders_2019-01-17.csv
-rwxr-xrwx. 1 root KamSQLData 5655 Feb 15 14:03 OD_Orders_2019-01-16.csv
-rwxr-xrwx. 1 root KamSQLData 2959 Feb 15 14:03 OD_Orders_2019-01-15.csv
-rwxr-xrwx. 1 kam KamSQLData 27084955 Feb 15 14:21 OD_Orders.csv
drwx------. 12 kam kam 4096 Feb 15 14:21 ..
drwxr-srwx. 2 root KamSQLData 20480 Feb 15 14:36 .


Than i went ahead and set the following to my directory:



sudo chmod -R 2775 /home/kam/KamSQLData/










share|improve this question
















I am having problems trying to load my .csv file into MySQL on my Centos box. My file is called 'OD_Orders.csv' is located in my home directory called /home/kam/KamSQLData



The error I get when I tried to load up the file into MySQL is:



mysql> LOAD DATA LOCAL INFILE '/home/kam/KamSQLData/OD_Orders.csv' INTO TABLE orders FIELDS TERMINATED BY ',' LINES TERMINATED BY 'n';
ERROR 13 (HY000): File '/home/kam/KamSQLData/OD_Orders.csv' not found (Errcode: 13)



I did some reading and the usual culprit is Unix permissions are off or wrong. I than proceed to create a group (called KamSQLData) so the userid of 'mysql' and 'kam' can share the group on /home/kam/KamSQLData:



KamSQLData:x:512:mysql,kam



I then proceed to set /home/kam/KamSQLData as the group of 'KamSQLData', thinking both kam and mysql will have access to it.




-rwxr-xrwx. 1 root KamSQLData 2322 Feb 15 14:03 OD_Orders_2019-01-28.csv
-rwxr-xrwx. 1 root KamSQLData 5282 Feb 15 14:03 OD_Orders_2019-01-25.csv
-rwxr-xrwx. 1 root KamSQLData 4428 Feb 15 14:03 OD_Orders_2019-01-24.csv
-rwxr-xrwx. 1 root KamSQLData 9784 Feb 15 14:03 OD_Orders_2019-01-23.csv
-rwxr-xrwx. 1 root KamSQLData 3795 Feb 15 14:03 OD_Orders_2019-01-22.csv
-rwxr-xrwx. 1 root KamSQLData 11004 Feb 15 14:03 OD_Orders_2019-01-18.csv
-rwxr-xrwx. 1 root KamSQLData 3528 Feb 15 14:03 OD_Orders_2019-01-17.csv
-rwxr-xrwx. 1 root KamSQLData 5655 Feb 15 14:03 OD_Orders_2019-01-16.csv
-rwxr-xrwx. 1 root KamSQLData 2959 Feb 15 14:03 OD_Orders_2019-01-15.csv
-rwxr-xrwx. 1 kam KamSQLData 27084955 Feb 15 14:21 OD_Orders.csv
drwx------. 12 kam kam 4096 Feb 15 14:21 ..
drwxr-srwx. 2 root KamSQLData 20480 Feb 15 14:36 .


Than i went ahead and set the following to my directory:



sudo chmod -R 2775 /home/kam/KamSQLData/







centos






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 16 at 10:02









Rui F Ribeiro

40.8k1479137




40.8k1479137










asked Feb 15 at 20:32









KamKam

134




134













  • Comments are not for extended discussion; this conversation has been moved to chat.

    – terdon
    Feb 20 at 17:43



















  • Comments are not for extended discussion; this conversation has been moved to chat.

    – terdon
    Feb 20 at 17:43

















Comments are not for extended discussion; this conversation has been moved to chat.

– terdon
Feb 20 at 17:43





Comments are not for extended discussion; this conversation has been moved to chat.

– terdon
Feb 20 at 17:43










1 Answer
1






active

oldest

votes


















0














I ended taking the suggestion of Haxiel, where is never a good idea to make changes to the home directory (since everyone creation account(s) starts there). I placed my source data folder on /tmp and it already had the proper permission on that folder already (though I did run chmod -R 2775 to make sure). I was able to Load my .csv file(s) from that directory without modifying anything on SELinux or the home directory permission.






share|improve this answer























    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "106"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500945%2funix-permission-to-load-a-csv-file-into-mysql%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I ended taking the suggestion of Haxiel, where is never a good idea to make changes to the home directory (since everyone creation account(s) starts there). I placed my source data folder on /tmp and it already had the proper permission on that folder already (though I did run chmod -R 2775 to make sure). I was able to Load my .csv file(s) from that directory without modifying anything on SELinux or the home directory permission.






    share|improve this answer




























      0














      I ended taking the suggestion of Haxiel, where is never a good idea to make changes to the home directory (since everyone creation account(s) starts there). I placed my source data folder on /tmp and it already had the proper permission on that folder already (though I did run chmod -R 2775 to make sure). I was able to Load my .csv file(s) from that directory without modifying anything on SELinux or the home directory permission.






      share|improve this answer


























        0












        0








        0







        I ended taking the suggestion of Haxiel, where is never a good idea to make changes to the home directory (since everyone creation account(s) starts there). I placed my source data folder on /tmp and it already had the proper permission on that folder already (though I did run chmod -R 2775 to make sure). I was able to Load my .csv file(s) from that directory without modifying anything on SELinux or the home directory permission.






        share|improve this answer













        I ended taking the suggestion of Haxiel, where is never a good idea to make changes to the home directory (since everyone creation account(s) starts there). I placed my source data folder on /tmp and it already had the proper permission on that folder already (though I did run chmod -R 2775 to make sure). I was able to Load my .csv file(s) from that directory without modifying anything on SELinux or the home directory permission.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 22 at 17:14









        KamKam

        134




        134






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Unix & Linux Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f500945%2funix-permission-to-load-a-csv-file-into-mysql%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

            is 'sed' thread safe

            How to make a Squid Proxy server?