Exporting database through my java code
I want to export my MySQL database using my java code. But I have not found any way to do. What I want to do that there is a button in my app as "Export Database". When that button is clicked, my database should be exported to specified path. I have used the following code but it does'nt worked : Runtime runtime = Runtime.getRuntime(); runtime.exec("C:\\Program Files\\MySql\\MySql Server 5.5\\bin\\mysqldump -u root -p myDatabase> D:\\backup.sql"); How should I do this task. Thanks. Two problems : the space between -p and the password the space inside the path to the executable Prefer this :