Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. hello stuck in restore of mysql via java IO

hello stuck in restore of mysql via java IO

Scheduled Pinned Locked Moved Java
databasehelpjavamysqlvisual-studio
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Alok Sharma ji
    wrote on last edited by
    #1

    hi i have successfully done the backup process of mysql in java but when it came to restore i failed after trying for three hrs. and i desperately need it i dont know what i am doing wrong in my code , currently my IDE is netbeans

    String ip="localhost";
    String port="3306";
    String database="dbname";
    String user="user";
    String pass="pass";
    String path;
    JFileChooser chooser = new JFileChooser();
    chooser.setCurrentDirectory(new File("."));
    chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
    chooser.showSaveDialog(null);
    path = chooser.getSelectedFile().getAbsolutePath();
    System.out.println(path);

        String dumpCommand ="mysql" + " -h" + ip +" -port"+ port + " -u" + user +" -p" + pass+" "+ database +" <"+path;
        //"mysql -hlocalhost -port3306 -uroot -pamit mms 
    

    it always shows some sql help commands in system.out and the command "<" is surely not accessing in java code instead by using it , it gives the output as unknown command \b (start of backupfile name as c:\backup.sql)
    :confused:

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups