nagalla pruthvi
nagalla pruthvi

Reputation: 55

Start mysql server from java

How to start and stop mysql server from java(OSX) programtically?Can someone provide a code snippet for this. Non of the code snippets given in stackoverflow are working properly.

Upvotes: 0

Views: 1114

Answers (1)

Keews
Keews

Reputation: 249

I'm sorry, I can't comment because I do not have enough reputation.

What you could try is running the start script from the command line. That means getting the runtime and setting the command tou need. i.e,

Runtime.getRuntime.exec("sudo /usr/local/mysql/support-files/mysql.server start");

Another possibility would be to create a ProccesBuilder and set the params you need for the startup.

Hope this helps.

Upvotes: 2

Related Questions