gpt4 book ai didi

mysql - 将 gzip mysql 表文件加载到本地 mysql 时出错

转载 作者:行者123 更新时间:2023-11-29 09:57:21 27 4
gpt4 key购买 nike

我用 gzip 从远程服务器转储了一个文件,这样:

mysqldump -uuser -h host_address -ppassword --quick --compress --max_allowed_packet=512M db_name table_name | gzip  > my_dmp.sql.gz

并在本地重新加载它,如下所示:

gunzip < my_dmp.sql.gz | mysql -uroot -h 127.0.0.1 --quick --compress --max_allowed_packet=512M DatabaseName

它以前工作过,现在仍然工作,但现在在加载过程中出现此错误:

gunzip: (stdin): unexpected end of file

ERROR 1064 (42000) at line 276: 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 ''20' at line 1

我不太明白,因为如果文件中有问题,为什么当我转到本地表时,它是用 4m 条记录中的 1.5m 条记录创建的

有什么建议吗?

谢谢!

最佳答案

基于信息:

gunzip: (stdin): unexpected end of file

您的压缩文件不正确。为了确保您可以尝试以下操作:

gzip -dc my_dmp.sql.gz >/dev/null

如果此命令返回错误,请确认它。

关于mysql - 将 gzip mysql 表文件加载到本地 mysql 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53620090/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com