MySQL Table DDL file with phpMyAdmin

If you need a structure only .sql file of a MySQL tables’ Data Definition Language (DDL), phpMyAdmin makes this super-easy with just a few clicks. Continue reading and learn how…


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.

Practice Data

The target table I’m using for the examples in this post is a fictitious project table with this structure:

Table structure with phpMyAdmin.

How to create a DDL only .sql file with phpMyAdmin

Step 1:

Click the Export tab located in the top ribbon of phpMyAdmin:

Export tab in 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!!!

Step 2:

In the Export method section, select the Custom – display all possible options radio button and make sure the Format dropdown is set to SQL:

phpMyAdmin Export method.

Step 3:

In the Format-specific options section, click the structure radio button:

phpMyAdmin Format-specific options.

Step 4:

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!

Similar Reading

Enjoy these blog posts I have written on similar topics. Please share them with other readers as well. Thank you!

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.

Hey thanks for commenting! Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.