window環境下mysql導入sql文件時報錯:ERROR: ASCII '\0' appeared in the statement


錯誤信息:

ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected. Query: '蘒'.

解決方案:

1、使用ultraedit打開sql文件

2、查看文件編碼方式(我的是UTF-16)

3、點擊文件->另存為->修改編碼方式為UTF-8(數據庫的編碼方式)即可

 

再次執行:

mysql -uroot -p testDb < test.sql

 

隨記:

mysql導出文件:mysqldump -uroot -p testDb > test.sql


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM