首页 > 数据库 >mysqldump 导出来的文件,使用 source还原时报错“ASCII '\0' appeared in the statement, but this is not all

mysqldump 导出来的文件,使用 source还原时报错“ASCII '\0' appeared in the statement, but this is not all

时间:2023-10-08 14:23:33浏览次数:52  
标签:table1 unless source appeared allowed 导出 -- mysqldump mysql

导出语句:mysqldump -uroot -pword --databases db1 --tables table1 > ./sqldumps/archive-table1-`date +"%Y%m%d_%H%M%S"`.sql
导出后,使用source还原 报错:ASCII '\0' appeared in the statement, but this is not allowed unless option
我开始以为是我导出的编码格式有问题,换了新的导出语句,指定导出的编码格式
mysqldump --default-character-set=utf8 -uroot -pword --databases db1 --tables table1 > ./sqldumps/archive-table1-`date +"%Y%m%d_%H%M%S"`.sql
使用source 还原,还是报一样的错,后来发现是,链接mysql的时候,需要增加参数。--binary-mode=1
mysql --binary-mode=1 -uroot -p
如果是windows系统部署的mysql 可以使用下面的命令
进入到mysql的部署目录,然后,执行mysql.exe文件,带参数
C:\Program Files\MySQL\MySQL Server 5.7\bin>mysql.exe -u root -p --binary-mode=1
输入密码
show databases;
use db1;
source 绝对路径的SQL文件
即可进行数据还原

标签:table1,unless,source,appeared,allowed,导出,--,mysqldump,mysql
From: https://www.cnblogs.com/darling331/p/17748942.html

相关文章

  • Cannot find module ‘node:module‘ & "plugins" is not allowed 的解决办法
    在写demo时,装了下t-design-vue2的框架,想做个按需加载,官网这样说但是我运行以后发现报错了Error:Cannotfindmodule'node:module'Requirestack:-D:\ruanjian\nvm\v19.0.0\xiangmu\niu789\niu789\node_modules\[email protected]@mlly\dist\index.cjs摸不着......
  • C语言:‘for‘ loop initial declarations are only allowed in C99 mode
    求最大公约数之穷举法mistake: because: 只允许在C99模式下使用‘for’循环初始化声明  solution:不在for()中初始化生命变量 ......
  • 【IIS】HTTP 错误 405.0 - Method Not Allowed,无法显示您正在查找的页面,因为使用了无
    转自:https://blog.csdn.net/weixin_38211198/article/details/103597330问题HTTP 错误 405.0 - Method Not Allowed无法显示您正在查找的页面,因为使用了无效方法(HTTP 谓词)。 解决在IIS中,找到处理程序映射上面的报错已经指明是WebDAVModule模块,找到该模块  ......
  • [RxJS] "Animation Allowed" problem
    consttasks=of([....]);/***{*...{...4......5......2}*...........{3...........2...5}*..................................{6....3}*..........................................{3..4....2}*}**/constanimationAllowed=t......
  • ci框架url传递参数出现:The URI you submitted has disallowed characters
    原因:这是由于uri中存在CI不允许的字符。解决办法:在config/config.php文件中,找到$config['permitted_uri_chars']='a-z0-9~%.:_/-i';在里面添加允许的字符。如我需要添加@符号,则可以这样:$config['permitted_uri_chars']='a-z0-9~%.:_/-i@......
  • allowedOrigins cannot contain the special value "*"
    SpringBoot的版本高于2.4以后,原来的配置已经不适合目前的版本将代码中的allowedOrigins改为allowedOriginPatterns@ConfigurationpublicclassWebConfigimplementsWebMvcConfigurer{/***跨域支持**@paramregistry*/@Override......
  • nginx: 405 not allowed问题解决
    问题背景:第三方跳转我方一个静态页面,该页面在浏览器地址栏输入url链接后可以直接访问,但对方系统跳转时nginx报405 notallowed原因:前后端分离项目,前端采用nginx部署,nginx默认配置是不支持post请求静态资源的,而对方跳转时采用的post请求,所以nginx拦截报405解......
  • mysql连接的时候,null, message from server: “Host ‘xx.xx.xx.xx‘ is not allowed
    连接mysql的时候,提示“null,messagefromserver:“Host‘xx.xx.xx.xx‘isnotallowedtoconnecttothisMySQLserver“”解决出现这个提示,是由于我们使用root用户登录时,没有给root用户设置能访问的机器,所以我们设置一下,就可以了。第一步:登录mysql:输入 mysql-uroot......
  • 无涯教程-Perl - unless...elsif..else 语句函数
    除非unless语句后可以跟可选的elsif...else语句,这对于使用单个unless...elsif语句测试各种条件非常有用。unless...elsif..else-语法Perl编程语言中的unless...elsif...else语句的语法是-unless(boolean_expression1){#Executeswhenthebooleanexpression......
  • 无涯教程-Perl - unless 语句函数
    Perl的除非unless语句由一个布尔表达式和一个或多个语句组成。unless-语法Perl编程语言中的exclude语句的语法是-unless(boolean_expression){#statement(s)willexecuteifthegivenconditionisfalse}如果布尔表达式的输出为false,则将执行exclude语句中的代......