MySqldump Backup issue
I am trying to perform a backup in java gui app, on a database hosted on a friend's linux machine.
I made some research and the best thing i found was this :
String pp= new String("cmd mysqldump -h <HOST> -u <USERNAME> -p <PASSWORD> DATABASENAME -rbackup.sql");
Process p = Runtime.getRuntime().exec(pp);
Now, I am not sure what exactly is going on since I don't have any physical access to the linux machine at this moment, but I if try to type that command in cmd, i am getting "denied access", if I ommit the -p <PASSWORD>, hit enter, and it asks for the password, i put it in, and I can see the dump process going... now my issue is, is there anyway I can get that file (backup.sql) from the server to the client ? if there is, how to implement it in java.
if not, can anyone show me some java code to iterate over all the tables in the DB from the client side save them to a text file
mmm . i see what's your saying, .. how about some loop that reads all the tables , data with the structures, saves them to a file on the client, and another loop that creates the db, tables if not exists and INSERT all the data back again when restoring... I have many tables but not too much data .. and I will backup once a month ... so time efficiency is not a big problem here.
can I find the code anywhere ...