1

So, I'm trying to move an existing MySQL database from a Win2008 server to an Ubuntu machine, however when I try to import the dump file, MySQL is giving me a syntax error.

Below are the steps I took

  1. (on windows machine, in mysql\bin)

    .\mysqldump.exe -u root -p test > test.sql
    
  2. (on windows machine, in cygwin)

     scp test.sql myusername@hostname:~/
    
  3. (on ubuntu machine)

    $ mysql
    mysql> create table test2;
    $ mysql -u root -p test2 < test.sql  
    

MySQL then stalls for a litle bit, and then throws... ERROR 1064 (42000) at line 1: You have an error...

It's as if the error is in the dump file generated by windows. It is something in character conversion? or formatting? or something that I'm just just missing?

EDIT:

The error was that I needed to run a refresh before running mysqldump.exe. The command that did the trick was....

./mysqladmin.exe -u root -p refresh
5
  • 1
    It's hard to tell without seeing the entire error message as well as the query where it is raised. Commented Aug 24, 2011 at 22:51
  • The only error that was generated was the standard run-of-the-mill MySQL syntax error with just a single quote (') about 100 blank lines, and then a closing single quote. Commented Aug 25, 2011 at 17:42
  • Did you check your SQL dump to see if it makes sense? Commented Aug 25, 2011 at 20:04
  • Yes, the file made sense, it was too large to fully parse, however, it seemed a refresh fixed my problem. See edit above. Thanks anyways! :) Commented Aug 25, 2011 at 21:21
  • Interesting... I've never heard about 'refresh' before Commented Aug 26, 2011 at 7:03

1 Answer 1

1

EDIT:

The error was that I needed to run a refresh before running mysqldump.exe. The command that did the trick was....

./mysqladmin.exe -u root -p refresh
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.