Can't load local file into mysql database












0















So I will preface this by saying that I'm not all that skilled in MySQL (or regular SQL for that matter), but I'm trying to load data from a .txt file into my table that I keep for ticket sales. When I do that using:



LOAD DATA LOCAL INFILE '/path/presales1.txt' INTO TABLE presales


I get the '> prompter. And I have no idea what to do. I tried looking up solutions and the one I thought would work was:
--local-infile[=1]; because that is straight out the MySQL handbook. It didn't work (nor did any variation on it...such as local-infile=1;, local-infile=1 etc....)



Did I miss a simple step? My version of MySQL is 5.7










share|improve this question














bumped to the homepage by Community 2 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.




















    0















    So I will preface this by saying that I'm not all that skilled in MySQL (or regular SQL for that matter), but I'm trying to load data from a .txt file into my table that I keep for ticket sales. When I do that using:



    LOAD DATA LOCAL INFILE '/path/presales1.txt' INTO TABLE presales


    I get the '> prompter. And I have no idea what to do. I tried looking up solutions and the one I thought would work was:
    --local-infile[=1]; because that is straight out the MySQL handbook. It didn't work (nor did any variation on it...such as local-infile=1;, local-infile=1 etc....)



    Did I miss a simple step? My version of MySQL is 5.7










    share|improve this question














    bumped to the homepage by Community 2 mins ago


    This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.


















      0












      0








      0








      So I will preface this by saying that I'm not all that skilled in MySQL (or regular SQL for that matter), but I'm trying to load data from a .txt file into my table that I keep for ticket sales. When I do that using:



      LOAD DATA LOCAL INFILE '/path/presales1.txt' INTO TABLE presales


      I get the '> prompter. And I have no idea what to do. I tried looking up solutions and the one I thought would work was:
      --local-infile[=1]; because that is straight out the MySQL handbook. It didn't work (nor did any variation on it...such as local-infile=1;, local-infile=1 etc....)



      Did I miss a simple step? My version of MySQL is 5.7










      share|improve this question














      So I will preface this by saying that I'm not all that skilled in MySQL (or regular SQL for that matter), but I'm trying to load data from a .txt file into my table that I keep for ticket sales. When I do that using:



      LOAD DATA LOCAL INFILE '/path/presales1.txt' INTO TABLE presales


      I get the '> prompter. And I have no idea what to do. I tried looking up solutions and the one I thought would work was:
      --local-infile[=1]; because that is straight out the MySQL handbook. It didn't work (nor did any variation on it...such as local-infile=1;, local-infile=1 etc....)



      Did I miss a simple step? My version of MySQL is 5.7







      mysql mysql-5.7






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 4 '17 at 1:59









      Adam McGurkAdam McGurk

      1234




      1234





      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







      bumped to the homepage by Community 2 mins ago


      This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Watch carefully, everything is up my sleeve.



          mysql> SELECT 'abc
          '>
          '>
          '> def';
          +-----------+
          | abc


          def |
          +-----------+
          | abc


          def |
          +-----------+
          1 row in set (0.00 sec)


          Notice that my first line has a quote, but not the matching quote. When I hit return; it prompted me with '> -- That's the clue that I need to balance the quotes. Eventually, I did so, and the query terminated.



          Look around, I suspect there is a stray quote on the preceding or following line. Or the quotes around the filename aren't really the same.






          share|improve this answer
























          • OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

            – Adam McGurk
            Feb 4 '17 at 2:34











          • Either turn backslashes into forward, or double them up.

            – Rick James
            Feb 4 '17 at 4:43











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "182"
          };
          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%2fdba.stackexchange.com%2fquestions%2f163204%2fcant-load-local-file-into-mysql-database%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














          Watch carefully, everything is up my sleeve.



          mysql> SELECT 'abc
          '>
          '>
          '> def';
          +-----------+
          | abc


          def |
          +-----------+
          | abc


          def |
          +-----------+
          1 row in set (0.00 sec)


          Notice that my first line has a quote, but not the matching quote. When I hit return; it prompted me with '> -- That's the clue that I need to balance the quotes. Eventually, I did so, and the query terminated.



          Look around, I suspect there is a stray quote on the preceding or following line. Or the quotes around the filename aren't really the same.






          share|improve this answer
























          • OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

            – Adam McGurk
            Feb 4 '17 at 2:34











          • Either turn backslashes into forward, or double them up.

            – Rick James
            Feb 4 '17 at 4:43
















          0














          Watch carefully, everything is up my sleeve.



          mysql> SELECT 'abc
          '>
          '>
          '> def';
          +-----------+
          | abc


          def |
          +-----------+
          | abc


          def |
          +-----------+
          1 row in set (0.00 sec)


          Notice that my first line has a quote, but not the matching quote. When I hit return; it prompted me with '> -- That's the clue that I need to balance the quotes. Eventually, I did so, and the query terminated.



          Look around, I suspect there is a stray quote on the preceding or following line. Or the quotes around the filename aren't really the same.






          share|improve this answer
























          • OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

            – Adam McGurk
            Feb 4 '17 at 2:34











          • Either turn backslashes into forward, or double them up.

            – Rick James
            Feb 4 '17 at 4:43














          0












          0








          0







          Watch carefully, everything is up my sleeve.



          mysql> SELECT 'abc
          '>
          '>
          '> def';
          +-----------+
          | abc


          def |
          +-----------+
          | abc


          def |
          +-----------+
          1 row in set (0.00 sec)


          Notice that my first line has a quote, but not the matching quote. When I hit return; it prompted me with '> -- That's the clue that I need to balance the quotes. Eventually, I did so, and the query terminated.



          Look around, I suspect there is a stray quote on the preceding or following line. Or the quotes around the filename aren't really the same.






          share|improve this answer













          Watch carefully, everything is up my sleeve.



          mysql> SELECT 'abc
          '>
          '>
          '> def';
          +-----------+
          | abc


          def |
          +-----------+
          | abc


          def |
          +-----------+
          1 row in set (0.00 sec)


          Notice that my first line has a quote, but not the matching quote. When I hit return; it prompted me with '> -- That's the clue that I need to balance the quotes. Eventually, I did so, and the query terminated.



          Look around, I suspect there is a stray quote on the preceding or following line. Or the quotes around the filename aren't really the same.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 4 '17 at 2:24









          Rick JamesRick James

          41.9k22258




          41.9k22258













          • OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

            – Adam McGurk
            Feb 4 '17 at 2:34











          • Either turn backslashes into forward, or double them up.

            – Rick James
            Feb 4 '17 at 4:43



















          • OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

            – Adam McGurk
            Feb 4 '17 at 2:34











          • Either turn backslashes into forward, or double them up.

            – Rick James
            Feb 4 '17 at 4:43

















          OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

          – Adam McGurk
          Feb 4 '17 at 2:34





          OK....so I figured you were referring to syntax (not sure syntactically what I did wrong still) and separated my commands like this: <br /> LOAD DATA LOCAL INFILE '/path/presales1.txt' <br /> INTO TABLE presales; <br /> And no longer got the prompt. Instead, it terminated with a file/path does not exist error....even though I know the path is true because all I did was copy it straight from Windows Explorer. So I still have the issue, just different error message.

          – Adam McGurk
          Feb 4 '17 at 2:34













          Either turn backslashes into forward, or double them up.

          – Rick James
          Feb 4 '17 at 4:43





          Either turn backslashes into forward, or double them up.

          – Rick James
          Feb 4 '17 at 4:43


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Database Administrators 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%2fdba.stackexchange.com%2fquestions%2f163204%2fcant-load-local-file-into-mysql-database%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

          Liste der Baudenkmale in Friedland (Mecklenburg)

          Single-Malt-Whisky

          Czorneboh