Simple Backup and Restore for mysql Database from Java
How to backup a mysql database from a java code such that: It's saving path is dynamically allocated. Spaces in Path do not create problems. Path is generated using the executing jar file. DBname,DBusername or DBpass are dynamically allotted. Creating a specialized folder to save the backup file. Note: The codes given below are one way of solving the problem and probably not the best method. Everything is changeable inside the code. If you do not have mysql in environment variables, add the path before mysqldump and mysql (e.g. For XAMPP, C:\xampp\mysql\bin\mysqldump) (Hope, this will solve