How to restore a MySQL database backup using Java

前端 未结 8 2142
日久生厌
日久生厌 2020-12-10 22:57

I was able to create a backup of my current mysql database as .SQL file using the mysqldump.exe with the help of the following java code. <

8条回答
  •  感情败类
    2020-12-10 23:31

    Use the same dump to import like this.

    Process runProcess = Runtime.getRuntime().exec("C:\\SCM Files\\SQL Backup\\mysqldump.exe -uroot -p123 rr  database_name < "C:\\SCM Files\\SQL Backup\\RR.sql");
    

提交回复
热议问题