在windows服务器上导入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: '?-'.

后来百度了一下,发现这样一个回答:

The reference to --binary-mode (introduced in MySQL 5.6.3) is probably a distraction.

It doesn't sound like you're dealing with a mysqldump output file, there. Try the file utility.

shell> file dumpfile.sql

dumpfile.sql: ASCII text

If you don't get the ASCII text response, you're dealing with either something that isn't a dump file from mysqldump at all, or you're dealing with something that's been compressed (with

gzip or bzip2, for example), which you'd need to uncompress before

piping it into mysql.

大意是说,错误信息里的--binary-mode极具迷惑性。事实上,这并不意味着你的 sql文件里包含ASCII字符。可以先通过file命令查看该文件的字符类型。

于是将该sql文件上传至Linux服务器上,执行了一下file:

[root@localhost ~]# file dafanshu_db.sql

dafanshu_db.sql: Little-endian UTF-16 Unicode text, with very long lines, with CRLF line terminators

结果很明显,这里面并没有什么ASCII字符,所以即使将mysql设置成--binary-mode,也无济于事,是文件格式的问题。

后来无意中发现,用more查看这个文件,无法正常显示任何内容,用vi却可以。这更加说明,这个sql文件绝对不是普通的文本文件。

最后想起,这个sql文件是在powershell里导出来的。于是尝试在cmd下重新导一次,然后再导入,就正常了。这坑爹的powershell。。。

mysql binary mode_导入mysql文件提示“ASCII \'\\0\' appeared in the statement”-wwmshe-ChinaUnix博客...相关推荐

  1. 【mysql】 mysql备份还原时发生异常:导入mysql文件提示“ASCII '\0' appeared in the statement”

    小Z今天在备份还原Mysql数据库,出现了 导入mysql文件提示"ASCII '\0' appeared in the statement" ,并不意味着我的sql文件中包含AS ...

  2. 导入mysql文件提示“ASCII '\0' appeared in the statement”

    在windows服务器上导入mysql文件时,出现以下报错: ASCII '\0' appeared in the statement, but this is not allowed unless ...

  3. mysql报ascii 0_导入mysql文件提示“ASCII '\0' appeared in the statement”

    在windows服务器上导入mysql文件时,出现以下报错:ASCII '\0' appeared in the statement, but this is not allowed unless o ...

  4. mysql报ascii 0_导入mysql文件提示“ASCII \'\\0\' appeared in the statement”

    [关键字:mysql jsp 图片存取为了使用JSP灵活,需要把各种文件储存到数据库中,然后需要的时候把它读取出来显示到客户端.这些文件包括音乐,图片,文本等,人们统称为二 在windows服务器上导 ...

  5. Mysql | MariDB | 导入导出数据库 | 常见问题 | ASCII ‘\0‘ appeared in the statement

    文章目录 参考 window 1.导出整个数据库 2.导出一个表 3.导出一个数据库结构 4.导入数据库 5. 导入数据到数据库 6.导入数据到数据库中得某个表 linux 一.导出数据库 二.导入数 ...

  6. sql 导入linux问题:ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-m

    ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled ...

  7. mysql导入sql文件、数据库时报错ERROR: ASCII '\0' appeared in the statement

    window环境下mysql导入sql文件时报错:ERROR: ASCII '\0' appeared in the statement 错误原因 文件编码不正确 解决办法 下载UltraEdia对文 ...

  8. mysql导入sql文件、数据库时报错ERROR: ASCII ‘\0‘ appeared in the statement

    mysql导入sql文件.数据库时报错ERROR: ASCII '\0' appeared in the statement

  9. window环境下mysql导入sql文件时报错:ERROR: ASCII '\0' appeared in the statement

    错误信息: ERROR: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mo ...

最新文章

  1. 如何让老Mac机支持USB安装Windows
  2. mfc 怎么让键盘上下左右控制图片移动_[源码和文档分享]基于MFC的陨石撞飞机游戏设计与实现...
  3. Java线程详解(2)-创建与启动
  4. Xamarin.Forms中使用LiteDB分页
  5. form表单中的input有哪些类型
  6. maven配置 mysql_maven项目使用mybatis+mysql
  7. Android 系统定时管理器AlarmManager的使用
  8. GridView.RowCommand 事件
  9. VMware Server1.03下载地址及序列号
  10. wifi技术扫盲-MIMO
  11. Amplify Shader Editor手册 Unity ASE(中文版)
  12. Word操作之插入图片自动更改大小
  13. Eclipse的快捷键设置及使用
  14. 【整理】3dsMax中贴图显示模糊
  15. 2021-4-19课程——第5章例题【续】触发器+存储过程和函数
  16. Kademlia算法 理解 总结
  17. centos6关闭防火墙(zonealarm pro防火墙)
  18. 李炎恢jquery学习笔记
  19. Allegro专题【1】——orcad创建元器件方法
  20. 清泉HAL库开发STM32之USART

热门文章

  1. linux命令简写和全称和功能,Linux命令简写和全称
  2. php 判断是什么服务器,php判断服务器是apache还是nginx的方法
  3. 我的Blog文章索引::机器学习方法系列,深度学习方法系列,三十分钟理解系列等
  4. hadoop2 hdfs 垃圾箱简介
  5. Windows10聚焦背景纯灰色
  6. 木马,病毒,蠕虫的异同
  7. 安卓中两种压缩图片详解(比例压缩与质量压缩)
  8. 2022年全球与中国医院信息系统(HIS)行业发展趋势及投资战略分析报告
  9. PS如何快速找到对应的图层
  10. reading 摘录一