简体   繁体   English

有没有服务器查询MySQL数据文件(MyISAM / InnoDB)的库/工具? (SQLite方式)

[英]Is there a library / tool to query MySQL data files (MyISAM / InnoDB) without the server? (the SQLite way)

Oftentimes I want to query my MySQL data directly without a server running or without having access to the server (but having read / write rights to the files). 通常我想直接查询我的MySQL数据,而无需运行服务器或无法访问服务器(但具有对文件的读/写权限)。

Is there a tool or maybe even a library around to query MySQL data files like it is possible with SQLite? 是否有工具或甚至是一个库来查询MySQL数据文件,就像SQLite一样? I'm specifically looking for InnoDB and MyISAM support. 我特意寻找InnoDB和MyISAM支持。 Performance is not a factor. 表现不是一个因素。

I don't have any knowledge about MySQL internals, but I presume it should be possible to do and not too hard to get the specific code out? 我对MySQL内部没有任何了解,但我认为应该可以做到并且不太难以获得特定的代码?

Thank you for any suggestions! 谢谢你的任何建议!

I assume you are doing testing/dev work and dont want to run a server. 我假设您正在进行测试/开发工作而不想运行服务器。 I had to do this a while ago, and the best I came up with is exporting it to SQL and loading that into memory: 我不得不暂时这样做,我想出的最好的是将它导出到SQL并将其加载到内存中:

mysqldump -u root -pPASSWORD DATABASENAME TABLENAME > table.sql

HSQLDB is an in-memory relational database for java, you could run the queries into that, do the modification you need and then re-export the .sql file. HSQLDB是java的内存关系数据库,您可以运行查询,进行所需的修改,然后重新导出.sql文件。 Bit of a roundabout way of doing it... 做一点迂回的方式......

MySQL offers a client library which is basically a miniature server. MySQL提供了一个客户端库,它基本上是一个微型服务器。 It's called libmysqld. 它叫做libmysqld。 It is C/C++ only, though. 但它只是C / C ++。 According to the docs, it exports an identical API to the normal C/C++ client library. 根据文档,它将相同的API导出到普通的C / C ++客户端库。

MySQL Embedded client library MySQL嵌入式客户端库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM