Results 1 to 3 of 3
  1. #1
    bentael is offline Member
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    0

    Default 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

  2. #2
    syed.hussim is offline Member
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    0

    Default

    To get the dump from the server, you will either need to use RMI or implement a client/server program.

    Simple RMI Example | Java Snippet | SnippetBank.Net

    File Transfer Example Using Socket | Java Snippet | SnippetBank.Net

  3. #3
    bentael is offline Member
    Join Date
    Jun 2010
    Posts
    2
    Rep Power
    0

    Default

    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 ...

    thank you

Similar Threads

  1. MYSQLDUMP from Java
    By Robert_85 in forum Advanced Java
    Replies: 6
    Last Post: 11-18-2009, 03:33 PM
  2. run mysqldump command
    By anilkumar_vist in forum New To Java
    Replies: 4
    Last Post: 10-26-2009, 05:46 PM
  3. USB Backup
    By Mir in forum New To Java
    Replies: 5
    Last Post: 08-06-2008, 11:29 AM
  4. Areca Backup 6.0.1
    By Java Tip in forum Java Software
    Replies: 0
    Last Post: 04-01-2008, 04:12 PM
  5. Areca Backup 5.0
    By levent in forum Java Software
    Replies: 0
    Last Post: 05-29-2007, 03:07 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •