如何在没有 MySQL 的情况下浏览 mysql 数据库文件(*.frm、*.myd 和 *.myi)?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8629869/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I explore mysql database files (*.frm, *.myd and *.myi) without MySQL?
提问by mark
The old versions of our product allowed to capture the current state of the system in a single archive file, which also contains the MySQL database files - lots of <XXX.frm, XXX.myd, XXX.myi>triples .
我们产品的旧版本允许在单个存档文件中捕获系统的当前状态,该文件还包含 MySQL 数据库文件 - 许多<XXX.frm, XXX.myd, XXX.myi>三元组。
Now we have the next generation of the product, which does not do anything stupid like capturing the database files, but it must know to read the archives produced by the old versions.
现在我们有了下一代产品,它不会像捕获数据库文件那样做任何愚蠢的事情,但它必须知道读取旧版本产生的档案。
Our product is a commercial closed source product, but it is not very expensive. We had to stop using MySQL, because of the second reason (Oracle has changed the MySQL licensing) and we cannot use MariaDB, because of the first one (their licensing freaked the s*t out of the company lawer).
我们的产品是商业闭源产品,但价格不是很贵。我们不得不停止使用 MySQL,因为第二个原因(Oracle 改变了 MySQL 许可),我们不能使用 MariaDB,因为第一个(他们的许可吓坏了公司法律)。
So, my question is there another way to read these MySQL database files? A commercial light weight solution is fine - after all, we are talking about read-only exploration of the database files. Free/Open Source alternatives are welcome too, as long as they do not mean that the code using them must be Open Source too.
所以,我的问题是有另一种方式来读取这些 MySQL 数据库文件吗?商业轻量级解决方案很好——毕竟,我们谈论的是对数据库文件的只读探索。免费/开源替代品也是受欢迎的,只要它们并不意味着使用它们的代码也必须是开源的。
Thanks.
谢谢。
EDIT
编辑
Besides the issue whether I can or cannot continue using the old version of MySql to read the old MySql database files, the question remains how can I read them? I mean, MySql is no longer our database, so even if I can bundle with the old MySql implementation, do I have to install the full blown database engine to just read the files? I'd rather avoid that.
除了是否可以继续使用旧版本的 MySql 读取旧的 MySql 数据库文件的问题外,问题仍然是如何读取它们?我的意思是,MySql 不再是我们的数据库,所以即使我可以与旧的 MySql 实现捆绑在一起,我是否必须安装完整的数据库引擎才能读取文件?我宁愿避免这种情况。
回答by ravnur
If you want to go thru tables structure it would be enough to read the following links. MySQL internals (all), File Format, MyISAM
如果您想了解表格结构,阅读以下链接就足够了。 MySQL 内部(全部)、文件格式、MyISAM
If it is not enough and you database size less then 10G you can use Ms SQL Server Express (which is free with DB less than 10G. Page to compare different versions of Ms SQL Server is here). Search for the way to convert MySQL files to Ms SQL Server. Here is the first link a got from Bing: link1(I suppose not all of them need MySQL server)
如果这还不够,并且您的数据库大小小于 10G,您可以使用 Ms SQL Server Express(数据库小于 10G 是免费的。比较不同版本的 Ms SQL Server 的页面在这里)。搜索将 MySQL 文件转换为 Ms SQL Server 的方法。这是从 Bing 得到的第一个链接:link1(我想不是所有的都需要 MySQL 服务器)
If it is not suitable. You can try another MySQL forks like: XtraDB, OurDelta, Drizzle, PBX and so on.
如果不合适。您可以尝试其他 MySQL 分支,例如:XtraDB、OurDelta、Drizzle、PBX 等。
Hope you will find something useful.
希望你会找到有用的东西。
回答by mark
We have found a solution. Unfortunately, it involves MySQL, so there are potential licensing issues. Here it is - http://dev.mysql.com/doc/refman/5.0/en/libmysqld.html
我们找到了解决办法。不幸的是,它涉及 MySQL,因此存在潜在的许可问题。这是 - http://dev.mysql.com/doc/refman/5.0/en/libmysqld.html
All it takes is download the MySql source code and help yourself with:
只需下载 MySql 源代码并帮助自己:
- libmysqld.dll
- libmysqld.lib
- header files from the include folder
- mysqld.dll
- mysqld.lib
- 包含文件夹中的头文件
Then it is possible to read the files using the embedded MySQL database engine inside libmysqld.dll.
然后可以使用 libmysqld.dll 中的嵌入式 MySQL 数据库引擎读取文件。