This last part of the error message:
... near '; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 S' at line 7 at resultsDBsource.pl line 34, <FH> chunk 1.
looks sort of like the dump file has been edited in some way to place C-style commenting marks around some lines. I shouldn't be surprised of mysql rejects this (the normal way to comment out a line of SQL is to put two hyphens at the beginning.)

(UPDATE: I should have checked the mysql manual first; C-style comments are allowed, and comments starting with /*! are "special": not ignored, but used to flag statements that use mysql-specific extensions to SQL, and the digits following /*! indicate what (earliest) version of mysql is needed for the extended statement to work. What do you know about the version of the server you are using?)

Rather than reading the whole file as a into a single scalar, you should use the idea mentioned above, setting $/ to the string that marks the end of an sql statement, and read the file one statement at a time, and -- this is important -- on each statement, check for "/*commented strings*/" and remove them before preparing the statement.

If you are trying to load a database on a server where you do not have login shell access, you might want to have mysql running on your own machine, and try loading the dump file locally via a shell command line:

mysql test < dump.file
will load the file contents into the "test" database. Revise the dump file until that operation produces the desired result, then load the dump file on the remote server.

(If you are able to connect to the target database from anywhere via a login-shell "mysql" command, why not just load the dump file that way?)


In reply to Re: Import dump file into mysql DB using DBI by graff
in thread Import dump file into mysql DB using DBI by siva kumar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.