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?
Asked
Active
Viewed 56 times
0
-
If you used Workbench file and still have it, you can generate SQL queries by running migration again. – Tomasz Kowalczyk Nov 24 '14 at 23:02
1 Answers
1
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

Community
- 1
- 1

John Ruddell
- 25,283
- 6
- 57
- 86
-
Thank you. That works wonderfully! But what about the queries other than to create the table? say, used to add values to the tables? how can i retrieve those? – fantastic4 Nov 24 '14 at 23:15
-
@fantastic4 see my edit, i added a link to another question that answers that :) – John Ruddell Nov 24 '14 at 23:17
-
For related information, see http://dev.mysql.com/doc/workbench/en/wb-admin-export-import.html – Philip Olson Nov 25 '14 at 23:37