fantastic4
fantastic4

Reputation: 3

find original mysql query

I am learning mysql. I created a database with a few tables using mysql workbench. I forgot to save the queries used to create these tables. Can I still find the queries and save them?

Upvotes: 0

Views: 68

Answers (1)

John Ruddell
John Ruddell

Reputation: 25842

yes all you have to do is run this query with the appropriate table name

SHOW CREATE TABLE `table_name`;

the second column displays the actual query ran to create the table

EDIT:

Per the OP request if you want to see the insert statements you will have to do a dump see THIS LINK for a way to do that

ALSO since you are using workbench you could do it this way

Open MySQL Workbench > Home > Manage Import / Export (Right bottom) / Select Required DB > Advance Exports Options Tab >Complete Insert [Checked] > Start Export.

or if its 6.1 > then click the management tab (beside schemas) and choose Data Export

Upvotes: 1

Related Questions