如何匯入用引號列印編碼的MySQL轉儲?

如何匯入用引號列印編碼的MySQL轉儲?

我有一個 MySQL DDL 文件ddl.sql,我想導入它。它是這樣開始的:

--=20MySQL=20dump=2010.11=0A--=0A--=20Host:=20localhost=20=20=20=20=
Database:=20ww=0A--=20=
------------------------------------------------------=0A--=20Server=20=

我認為這是一種引用的可列印編碼。當我嘗試透過匯入此文件時,mysql testdb < ddl.sql出現以下錯誤:

ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '--=20MySQL=20dump=2010.11=0A--=0A--=20Host:=20localhost=20=20=20=20=Database:=2' at line 1

MySQL有沒有辦法讀取這種檔案?或者我必須先轉換它?有什麼想法嗎?

答案1

qprint解決方案是在導入之前對文件進行解碼。

相關內容