1

I want to use MySQL for my Java app, but is very important that the user hasn't to start or install any program before start the app, so, How can I install MySQL (If it's necessary) and start the MySQL server directly by code? Have I to use other database?

5
  • 2
    If you could do this, you could install all sorts of things the user didn't want or ask for. Commented Apr 24, 2013 at 18:27
  • 1
    H2 ? h2database.com/html/main.html or SQLite? Commented Apr 24, 2013 at 18:28
  • But I only want to launch the installer directly, namely, I want the user only has to click in next, I'm not interested in do it in background. Commented Apr 24, 2013 at 18:30
  • Maybe you can do with a "small" sql solution like SQLite (sqlite.org)? Maintaining a full blown MySql server is maybe overkill? Just a thought... Commented Apr 24, 2013 at 18:30
  • I'd go with HSQL/H2 as mentioned by leonbloy. You can have it persist to file so the data will still survive them resetting the application as well. Commented Apr 24, 2013 at 19:07

2 Answers 2

1

MySQL has released this presentation dealing with details on how to do it if needed. It lists these three options:

  • Embedded library
  • Silent windows install
  • Launch mysql form command line

Check the presentation for details (the .pdf in the .zip linked at the page).

Note that you have to be licence compliant also to do this. GPL for GPL, commercial for commercial.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use something like the Nullsoft Scriptable Install System (NSIS) to install MySQL on the user's computer, along with your Java application. Your Java application would have to create all of the tables needed by your Java application.

Your other alternative is to use a Java embedded database, like HSQLDB. Your user would just install your Java application.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.