I'm looking for a utility program which can take a dump of a mysql database and basically host a "fake" or minimal mysql server with that data for testing another program which requires it.

Has anyone seen something like this before?


  • 5
    A fully operational mysql server is not fake - it is the mysql server itself. – Ipor Sircer Nov 27 '17 at 3:59
  • 1
    What is the necessity of fake mysql server? What the term "fake" actually means? Why not installing mysql swever and restoring the backup? – Abhik Bose Nov 27 '17 at 4:05
  • fake, crude, etc. maybe the server does not have a full implementation of mysql's language? who knows.. I am asking if anybody knows of such a tool – Tanami Nov 27 '17 at 4:06
  • 2
    <humor>MariaDB</humor>. (Actually not accurate anyway, since it has more features than MySQL, not less.) Seriously, no, you'll not find such a tool. It would be ridiculously complicated to emulate a working database from a dump file, and for every feature not provided, it would be that much less useful. If you want to test against MySQL, test against MySQL. – Michael - sqlbot Nov 27 '17 at 6:27

If you have the dump as proper inserts, and it doesn't use any mysql specific features, you can try to load it in sqlite database. That's about as minimalistic as it goes. Note, however, that you won't be able to test it with the same code as used for mysql, since sqlite does not have a server. Your code will have to open the sqlite db file instead and do the statements on it. Most programming languages have sqlite support.

| improve this answer | |

All you need is provided by MySQL itself.

Install the MySQL server, start it, then load the dump with

mysql -uroot -p < mydump.sql

and you're good to go.

| improve this answer | |
  • 1
    I'm accepting this answer because it looks like the tool does not exist. I was thinking of something more like a wrapper around mysql-sandbox. – Tanami Nov 28 '17 at 5:09

Not the answer you're looking for? Browse other questions tagged or ask your own question.