2013-02-25 35 views
0

當我運行Ubuntu的終端上運行此命令:進口sql中轉儲到Postgres的

psql -h localhost -U arwinder --password -f sh_cake_db_14_02_13.sql -d new_db 

其中「arwinder」是用戶名和「sh_cake_db_14_02_13.sql」的SQL轉儲和「new_db」是數據庫。 然後導入時顯示以下錯誤,並在postgresql數據庫中我沒有所有的表。鄭大世是錯誤的:

invalid command \N 
invalid command \ 
invalid command \ 
ERROR: syntax error at or near "27" 
LINE 1: 27 Balaji Angan 
+0

SQL轉儲中第1行的內容是什麼? – 2013-02-25 09:07:45

回答

0

有一個轉換工具https://github.com/lanyrd/mysql-postgresql-converter,或者你可以參考PostgreSQL的的維基http://wiki.postgresql.org/wiki/Converting_from_other_Databases_to_PostgreSQL,看到MySQL的部分,檢查你的數據類型。

+0

請在http://sourceforge.net/projects/mysqltopostgres/鏈接上解釋一下工具... – 2013-02-25 07:55:52

+0

哦,它不工作。你可以試試這個https://github.com/lanyrd/mysql-postgresql-converter – pigletfly 2013-02-25 09:00:41

+0

你爲什麼認爲OP的轉儲是MySQL轉儲? – 2013-02-25 09:12:57