Windows 上无法读取字节码数据库 tar.gz (Maxmind)
根据我之前的问题(Maxmind 世界城市数据库问题(MySql)),我没有收到任何解决方案,只是用几条评论结束了我的问题(无论如何,感谢您的评论)。
我以另一种方式重新发布我的问题:如何有人以字节码形式导入 txt 文件中包含的数据库,压缩在 tar.gz 文件中的文件(可能是两次),并且在 Windows 的 MySQL 上导入。
这是文件:http://www.maxmind.com/app/worldcities
提前致谢,
Following my previous question (Maxmind world cities database issue (MySql)), for which I did not receive any solution, just closed my question with couple comments (anyway, thanks for the comments).
I repost my question in an other way : how could somebody import a database contained in txt file under bytecode form, file compressed in a tar.gz file (may be twice), and this on MySQL for Windows.
Here is the file : http://www.maxmind.com/app/worldcities
Thanks in advance,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个问题似乎影响了很多人,包括我。目前,MaxMind 论坛正在讨论该问题。您可能会发现它很有帮助 - 希望它能很快得到解决。
[编辑]已经解决了!正如您所说,该文件被压缩了两次。详细信息请参阅链接。
This is a problem which seems to be affecting a number of people, me included. The problem is currently being discusssed at the MaxMind forums. You may find it helpful to look- hopefully it can be resolved soon.
[EDIT] It's been solved! The file WAS compressed twice, as you said. See the link for details.
我在 a_horse help 中找到了解决方案:正如他所说,该文件被两次压缩(tar.gz),但方式错误。
过程如下:gunzip tar.gz 文件。你将会有一个 worldcitiespop.txt。将此文件重命名为 tar.gz。 Gunzip(如果需要则强制)此文件。您将获得一个 worldcitiespop.tar 文件。将此文件重命名为 txt,这就是它!
I found the solution with a_horse help : as he said, the file is twice zipped (tar.gz), but in the wrong way.
So here is the process : gunzip the tar.gz file. You gonna have a worldcitiespop.txt. Rename this file as a tar.gz. Gunzip (force if it's required) this file. You gonna obtain a worldcitiespop.tar file. Rename this file as a txt and here is it!
当您有此类格式错误的文件时,首先建议是使用 file。
file
查看文件的前几个字节魔法数字 它标识文件的格式,忽略潜在的误导性扩展名。使用此工具,您可以确定文件类型,将扩展名更改为适当的扩展名,然后继续提取,直到获得所需的纯文本。我希望您能原谅宽泛的答案,特别是在您已经找到特定问题的解决方案之后,但对于该网站的未来访问者来说,他们更有可能遇到“无法打开文件的扩展名错误”而不是您的具体问题。
When you have malformed files of this sort, the first advisable thing is to use a program like file.
file
looks at the first few bytes of a file for magic numbers which identify the format of the file, ignoring the potentially-misleading extension. Using this tool, you could have determined the filetype, changed the extension to the appropriate one, and continued extracting until you had the plaintext you were after.I hope you'll pardon the broad answer, especially after you've already found a solution to your specific problem, but for the purposes of future visitors to the site, it is more likely they have the general problem of "unable to open a file which has the wrong extension" than your specific issue.