If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!
Why use a DDL file?
Why would you need a structure-only .sql DDL file anyway?
Maybe you want to build out a tables’ structure on another server to bring in different data or something comparable, and want it void of any existing data.
Rather than creating the table by hand with manual MySQL commands, simply use the .sql DDL dump file.
The target table I’m using for the examples in this post is a fictitious project table with this structure:
How to create a DDL only .sql file with phpMyAdmin
Click the Export tab located in the top ribbon of phpMyAdmin:
Are you a Medium member? If so, receive an email notification each time I publish a blog post if you prefer the Medium platform. Not a member? No worries! Use my sign-up link (I will get a commission at no extra cost to you) and join. I really enjoy reading all the great content there and I know you will too!!!
In the Export method section, select the Custom – display all possible options radio button and make sure the Format dropdown is set to SQL:
In the Format-specific options section, click the structure radio button:
Keeping all of the other configuration options to their defaults, simply click the Go button located in the bottom right of the window to complete the Export:
The Newsletter for PHP and MySQL Developers
Receive a copy of my ebook, “10 MySQL Tips For Everyone”, absolutely free when you subscribe to the OpenLampTech newsletter.
Shown in the below Github gist, is the entire .sql dump file with the project tables’ DDL:
Way easy, right?!?
Like always, if you have questions or see any mistakes in the code, please share them freely in the comments section. Constructive comments help me provide accurate and valuable content and are much appreciated!
Consider making a donation as I continue to provide valuable content here on my blog. Thank you so much!!! Every bit is much appreciated and helps tremendously!
Enjoy these blog posts I have written on similar topics. Please share them with other readers as well. Thank you!
- Use MySQL Unique Constraint in phpMyAdmin
- PHP strtoupper() and strtolower() String Functions
- MySQL’s AUTO_INCREMENT Attribute
Thank you for reading this post. Please share it with someone else who would enjoy it as well.
Josh Otwell has a passion to grow as a PHP Developer, SQL expert, and technical blogger/writer.
Disclaimer: The majority of examples in this post, are performed in a personal development/learning workstation environment and should not be considered production quality or ready. Your particular goals and needs may vary. Like always, just because you can do something doesn’t mean you should. My opinions are my own.