今天想做个测试,把线上数据导出一份拿到本地,当使用source命令导出时出现了ERROR错误,详细如下:

ERROR: Unknown command '\i'.

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

连忙百度一下,得知在powershell里导出的sql文件就是会出错...。讲所导出文件传到linux服务器,用file命令查看结果是:

 Little-endian UTF-16 Unicode text, with very long lines, with CRLF line terminators,

重新在服务器里导出sql文件信息是:

UTF-8 Unicode text, with very long lines,

用cmd导出的sql文件信息是:

UTF-8 Unicode text, with very long lines, with CRLF line terminators,

好吧powershell导出文件是UTF-16编码,cmd和linux 导出都是UTF-8编码,区别不太清楚等我查清楚了再接着写吧。。。。

最后!cmd导出的sql文件source导入ok!