您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

详解mysqldump数据导出的问题

2024/3/25 7:20:42发布19次查看
下面小编就为大家带来一篇详谈mysqldump数据导出的问题。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
1,使用mysqldump时报错(1064),这个是因为mysqldump版本太低与当前数据库版本不一致导致的。
mysqldump: couldn't execute 'set option sql_quote_show_create=1': you have an error in your sql syntax; check the manual that corresponds to your mysql server version for the right syntax to use near 'option sql_quote_show_create=1' at line 1 (1064) [root@bastion-idc ~]# mysqldump --versionmysqldump ver 10.13 distrib 5.1.61, for redhat-linux-gnu (x86_64) [root@bastion-idc ~]# mysql //或者登陆mysql,select version();也可查看版本 server version: 5.6.25-log source distribution。。。。。
这样的话必须知道mysqldump的绝对路径,在mysql的安装目录下有。
2,导出时指定字符集,报错
character set 'utf-8' is not a compiled character set and is not specifie . --default-character-set=utf-8
这个是因为字符集错了。是--default-character-set=utf8
3,导出时提示warning,a partial dump from a server that has gtids
[root@bastion-idc ~]# mysqldump -uroot -p xqsj_db > xqsj_db20160811.sql warning: a partial dump from a server that has gtids will by default include the gtids of all transactions, even those that changed suppressed parts of the database. if you don't want to restore gtids, pass --set-gtid-purged=off. to make a complete dump, pass --all-databases --triggers --routines --events.
关于gtid是5.6以后,加入了全局事务 id (gtid) 来强化数据库的主备一致性,故障恢复,以及容错能力。
官方给的:a global transaction identifier (gtid) is a unique identifier created and associated with each transaction committed on the server of origin (master).
所以可能是因为在一个数据库里面唯一,但是当导入其他的库就有可能重复。所有会有一个提醒。
可以通过添加--set-gtid-purged=off 或者–gtid-mode=off这两个参数设置。
很有肯能是在导入库中重新生产gtid,而不用原来的。
[root@bastion-idc ~]# mysqldump -uroot --set-gtid-purged=off -p xqsj_db > xqsj_db20160811.sql #这样就ok了!
以上就是详解mysqldump数据导出的问题的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product