Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate CREATE statements for all MySql Tables

Tags:

I want All CREATE statements of MySql Tables in 1 query result.

For example, INFORMATION_SCHEMA contains all table names,comments etc. but where are the CREATE statements are stored in MySql ? can it be retrieved in one query for all tables ?

Currently i am retrieving TABLE ddl as below for 1 table. I have 100's of tables so i can repeat the same everytime which is time taking process

show create table row_format; 
like image 660
logan Avatar asked Aug 05 '13 05:08

logan


1 Answers

mysqldump -h localhost -u root -p --no-data --compact  some_db   mysqldump -d --compact --compatible=mysql323 ${dbname}|egrep -v "(^SET|^/\*\!)" 

How do I use mysqldump to export only the CREATE TABLE commands

like image 182
Praveen Prasannan Avatar answered Sep 29 '22 17:09

Praveen Prasannan