I would like to use a standalone MySQL instance specifically for one of my programs.
I am thinking about a situation, where my program spawns the MySQL server as a child process to perform a very specific task and shuts the instance down afterwards. Ideally all files needed to run MySQL, including database files, are within the installation directory of my program.
My questions are:
- Is this possible?
- What are files needed to run such an instance?
- Do I need a custom my.ini or can I control everything via parameters?
- How do I do initial setup steps, like setting the root password, programatically?
You should look at the embedded mysql server library. It allows you to run a mysql server inside a client application:
http://dev.mysql.com/doc/refman/5.1/en/libmysqld.html
But why not use something more suited to this sort of task like SQLite (http://www.sqlite.org/)