Mariadb / Mysql 导入时候提示 ASCII '\0' 错误

在导入数据的时候提示错误信息:

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

使用的命令行为:

gzip < iCare.gz | mysql -h192.168.1.6 -u -p Icare

解决办法

因为上面的方法使用了 gzip,所以不正确。

我们将上面的步骤分成了 2 步。

gunzip iCare.gz
mysql -h192.168.1.6 -u -p Icare 

上面 2 个步骤来进行导入就可以了。