开发者

migrate mysql from windows to unix. syntax error on generated file

开发者 https://www.devze.com 2023-03-30 19:01 出处:网络
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.

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 106开发者_如何学编程4 (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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号