Windows环境下使用mysqldump注意事项
通常,使用mysqldump导出一般用这样的方式:
mysqldump -u root -p --no-data [db-name] > [filename.sql]
但如果在Windows环境下,不管是CMD还是PowerShell,使用这个命令都会有问题,因为这样导出的sql文件,在Linux环境下会报错:
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.
这里显然是由于Windows环境下的编码方式和Linux不同导致。