mysql導入sql文件的時候報告ERROR: ASCII '\0' appeared in the statement


1、問題描述:

今天導入SQL文件做測試,但是執行的時候發現如下錯誤提示:

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: ''.
Bye

 

2、解決方法:

1)把SQL文件在頭加入sublime-file-save with encoding - utf-8 with bom,經過測試就可以了

 

2)網上還有說使用登入的時候加--binary-mode=1

mysql --binary-mode=1 -h127.0.0.1 -uroot -p123456 -P3306
mysql> use mysql;
mysql> source /data/tse.sql


免責聲明!

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



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