PHP Developer News

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:

I write a weekly email about SQL/PHP that I’m studying, learning about, and interested in. If that sounds like something you would like to be a part of, find out more about it here. Thank you!

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!

Use MySQL Unique Constraint in phpMyAdminPHP strtoupper() and strtolower() String FunctionsMySQL’s AUTO_INCREMENT Attribute Like what you have read? See anything incorrect? Please comment below and thank you for reading!!!
A Call To Action!
Thank you for taking the time to read this post. I truly hope you discovered something interesting and enlightening. Please share your findings here, with someone else you know who would get the same value out of it as well.
Visit the Portfolio-Projects page to see blog posts/technical writing I have completed for clients.

To receive email notifications (Never Spam) from this blog (“Digital Owl’s Prose”) for the latest blog posts as they are published, please subscribe (of your own volition) by clicking the ‘Click To Subscribe!’ button in the sidebar on the homepage! (Feel free at any time to review the Digital Owl’s Prose Privacy Policy Page for any questions you may have about: email updates, opt-in, opt-out, contact forms, etc…)
Be sure and visit the “Best Of” page for a collection of my best blog posts.
Josh Otwell has a passion to study and grow as a SQL Developer and blogger. Other favorite activities find him with his nose buried in a good book, article, or the Linux command line. Among those, he shares a love of tabletop RPG games, reading fantasy novels, and spending time with his wife and two daughters.
Disclaimer: The examples presented in this post are hypothetical ideas of how to achieve similar types of results. They are not the utmost best solution(s). The majority, if not all, of the examples provided, are performed on a personal development/learning workstation environment and should not be considered production quality or ready. Your particular goals and needs may vary. Use those practices that best benefit your needs and goals. Opinions are my own.
The post MySQL Table DDL file with phpMyAdmin appeared first on Digital Owl's Prose.

Most Popular in Database