SQLite. It's not opensource, it\s public domain, so you don't need to pay a license fee, but, there's always a but somewhere; this does not apply to Germany which has bonkers rules. Germany does not believe in public domain, so you need to buy a license for SQLite from Dr Richard Hipp, about $10,000. Don't need this license anywhere else.
Or you could do the simple thing that robbieDuncan posted and split your program into two parts. Create a shared API between the two that does not use the database, and have the non-gui portion of the application 'wrap' the MySQL C connector. You will only need to wrap a few simple functions. One to create/get a connection. Ones to execute statements, depending on whether they are updates/deletes/inserts or selects. Some simple ones to Start a transaction, and another to commit a transaction. Those simple ones shouldn't take more than a few days of work to get right, and the C connector will come with plenty of examples.
Hope that helps.