-1

I'm going to design my app that will use a mysql db, after doing it how do I make those who download my app do not have to install mysql by themselves and go crazy in doing so? I see for example that there are software that by installing create a custom mysql service.

Do you have any ideas!

Nio74
  • 41
  • 4
  • 1
    Your database should be hosted on a server. Your app should connect to the database on the server. – SedJ601 Dec 02 '19 at 15:46
  • If each instance of your app needs its own individual database, I would suggest using a database like SQLite. – SedJ601 Dec 02 '19 at 15:47
  • You're probably looking for an embedded DB. A question about using mysql this way has been posted here: https://stackoverflow.com/questions/1791417/java-mysql-is-there-a-way-to-embed-a-mysql-server-with-a-java-program An alternative to Sqlite would be [H2](https://www.h2database.com/html/main.html) As mentioned by Sedrick an embedded DB does not share data between machines, unless you write some way for the apps to communicate with each other into the app. – fabian Dec 02 '19 at 17:44
  • This seems to me the answer I was looking for thanks – Nio74 Dec 03 '19 at 09:08

1 Answers1

0

I don't think you can pack a MySQL database into a jar, but you can use something like a flyway script to setup a database like you want it to be like. Then you can use the installer to install the correct version of MySQL so the program and all it's dependencies get centralized.

Flyway docs: https://flywaydb.org/documentation/migrations

To make an installer you could try something like NSIS: https://nsis.sourceforge.io/Main_Page

Quadrivics
  • 181
  • 2
  • 10