0

To explain, I have a database db_Name. Over the course of development of my program, the parameters of this database has changed through the use of MySQL Workbench. Unfortunately the hard-coded construction of the database in my program has not been kept up to date.

Is there a way that I could return the code for the construction of my database in the latest version?

To explain: I'm looking for this code:

Table_Name_1(Tbl_Id CHAR(25) NOT NULL AUTO_INCREMENT, Field_1 CHAR(25) UNIQUE, Field_2 INT, PRIMARY KEY(Tbl_Id));
Table_Name_2(..........

etc.

Ben
  • 2,433
  • 5
  • 39
  • 69
  • Shouldn't be modifying your database through the designer of any management IDE. You need the ability to be able to keep your production database in sync through change scripts or other means. There's way too much to explain just to get to the point where I can begin to answer your immediate question. – The Muffin Man Oct 06 '14 at 22:29
  • `SHOW CREATE TABLE table_name` might be what you're looking for. Also, you might be able to create a Database Project in VS, import your database and have it generate the schema scripts. – Arian Motamedi Oct 06 '14 at 22:29
  • @PoweredByOrange That's it :) if you would like to add that as an answer I'll gladly accept. – Ben Oct 06 '14 at 22:37

1 Answers1

1

If you need SQL for database structure - you can backup your database to *.sql file without table data.

You can do that in MySQL Workbench.

Step-by-step guide:

How to take MySQL database backup using MySQL Workbench?

You can also use SHOW CREATE TABLE TableName sql statement to return database structure as data view.

Community
  • 1
  • 1
Kamil
  • 13,363
  • 24
  • 88
  • 183