I'm using a MySql database with a Java program, now I want to give the program to somebody else.
How to export the MySql database structure without the data in it, just the structure?
I'm using a MySql database with a Java program, now I want to give the program to somebody else.
How to export the MySql database structure without the data in it, just the structure?
You can use the -d option with mysqldump command
You Can Use MYSQL Administrator Tool its free http://dev.mysql.com/downloads/gui-tools/5.0.html
you'll find many options to export ur MYSQL DataBase
If you want to dump all tables from all databases and with no data (only database and table structures) you may use:
This will produce a .sql file that you can load onto a mysql server to create a fresh database. Use cases for this are not many in a production environment, but I do this on a weekly basis to reset servers which are linked to demo websites, so whatever the users do during the week, on sunday nights everything rolls back to "new" :)
Beware though that --no-data option will not include the view definition. So if yo had a view like following create view v1 select
a
.id
ASid
,a
.created_date
AScreated_date
from t1; with --no-data option, view definition will get changed to following create view v1 select 1 ASid
, 1 AScreated_date
you can also extract an individual table with the
--no-data
option