Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Pankajkumar PatelRank #181 · 13.4K reputationPosted Sep 16, 2021, 6:09 AM EDT
Hi Dhawan,
You can "get a dump of all tables DDL" using the mysqldump command line utility:
The -d option means "without data".
For more detail you can refer below article:
Hope, this will help you!
Rajanikant HawaldarRank #110 · 20.4K reputationPosted Sep 17, 2021, 9:50 AM EDT
Riddhi ValechaRank #794 · 2.9K reputationPosted Sep 17, 2021, 12:10 PM EDT
Vinitha TRank #8,005 · 230 reputationPosted Nov 20, 2021, 7:23 AM EST
mysqldump command line tool is used to dump all tables in databases managed by SQL and migrats the data to another server.
To dump the table structure for all tables in database:
mysqldump -d -u username -ppassword mydatabase > mydatabase_dump.sql
-d -> not to include data in the dump
-u -> username
-p -> password
mydatabase_dump.sql -> dumping the structure to a file.
There should be no space between -p and password
To dump a single table from your database.
mysqldump --no-data -u username -ppassword mydatabase tablename
--no-data can be used instead of -d
To dump a multiple table from your database.
mysqldump -d -u username -ppassword mydatabase tablename1 tablename2 tablename3
To create same table in another database:
mysql -u username -ppassword newdatabase < mydatabase_dump.sql
Rijwan AnsariRank #82 · 24.2K reputationPosted Nov 20, 2021, 9:17 AM EST