The table schema can be helpful for your MySQL debugging and MySQL optimization.
mysql> describe users; +----------------------+--------------+------+-----+------------+----------------+ | Field | Type | Null | Key | Default | Extra | +----------------------+--------------+------+-----+------------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | username | varchar(255) | YES | MUL | NULL | | | first_name | varchar(255) | YES | | NULL | | | last_name | varchar(255) | YES | | NULL | | +----------------------+--------------+------+-----+------------+----------------+
mysql> show create table users;
...
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) DEFAULT NULL,
`first_name` varchar(255) NOT NULL DEFAULT '',
`last_name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=369 DEFAULT CHARSET=latin1
...
$ mysqldump --no-data=true --add-drop-table=false fooThe word "foo" is the name of the database that you want to dump.
To put these results into a file of your choice:
$ mysqldump --no-data=true --add-drop-table=false foo > results.txt