在windows服务器上用mysql_source导入mysql文件时,出现以下报错:

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

意思是说:你的文件中有ASCII,但实际上不允许使用,除非用--binary-mode 参数;

事实上这个问题是文件的格式的问题

可能的情况:

数据库导出的时候用的是powershell,而导入的时候用的cmd,

或者是导入导出的powershell的版本不一样(操作系统不一样),

解决办法:

使用和导出的相同的方法导出导入数据库即可。

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐