0
Hello, I have the following method that backs up my database:
public static void makeBackup() throws IOException{
String caminho = "C:\\Program Files\\MySQL\\MySQL Workbench 6.3 CE\\mysqldump.exe";
ProcessBuilder pb = new ProcessBuilder(caminho, "--user=root",
"--password=root", "meuBD", "--result-file="
+ "C:\\Users\\Usuário\\Documents\\NetBeansProjects\\meuPrograma\\" + "Backup.txt");
pb.start();
}
The problem is: when I backup, it saves the entire system, including tables that are not needed, I want to backup a certain table, with a certain field.
What happens: I have a system that works with point card, that is, I create a point card per day for each process and, It may have processes with years of time, IE, the point card linked to the process will have thousands of Inserts, and I will make it possible to put this inside the system (update the bd directly from the system) and if I do the whole bd it would take time, but if I save the Drops Tables in one file and the Inserts in another would make it easier. And preferably, I can save the point cards that are linked to a specific process, because then, it further reduces the size of the backup.
From now on, thank you
So, actually it’s not taking the specific fields, it’s taking the records that have given given, let’s say, every process has several dots linked cards, and let’s say I want all the dots cards that have the id=3 process for example, you know? is a little different from picking up a particular column, but it already sums up quite the processing time of restoring the backup, if you know how to answer this other question, I really appreciate it!
– Thomas Braz Pinto
Dear in this case I know no other way than through select into outfile with Where clause, when you want to import the data use LOAD DATA INFILE 'FILENAME' INTO TABLE TABLENAME', ref: http://dev.mysql.com/doc/refman/5.7/en/load-data.html, this way you can create your own backup the way you want. I hope it helps.
– Nelson Aguiar
Thanks! I’ll try to do here!
– Thomas Braz Pinto