In this article, we will be looking at how to dump the table structure of a MySQL database. This is useful for debugging or troubleshooting issues with the database. First, let’s create a new MySQL database called “dump” and grant it the appropriate permissions: CREATE DATABASE dump; Next, we’ll need to create a file called “dump.sql” in the same directory as our MySQL database: CREATE TABLE dump ( id INT NOT NULL AUTO_INCREMENT, name TEXT NOT NULL ); Now let’s start dumping the table structure: DUMP TABLE dump; This will produce the following output: id 1 name “dump”
Syntax:
The only option that is different than creating an entire backup is the -d switch, which tells mysqldump not to output the data.
Example:
RELATED: How to Export a CSV file from MySQL Command Line