user2637538
user2637538

Reputation: 11

How to copy structure of database in newly created database in MySQL through java code?

I have already created one MySQL database.Now i want to create another MySQL database with same structure without data through java code(without create database,table queries in java) like export or import through Command Prompt. I do not know is this possible or not? please suggest any answer.

Upvotes: 1

Views: 304

Answers (1)

Thai Tran
Thai Tran

Reputation: 9925

Hard way: you can create a bash script to export old data and generate the new one based on your exported data and then, let java execute it for you

Better way: Use liquibase to migrate your database. You can export your data into Xml file and then, again use Liquibase API to import the data from Xml file to your new database

Upvotes: 1

Related Questions