Reputation: 3289
How do you view all the constraints (Primary keys, Secondary keys, Assertions , Triggers, etc) in a MySQL Database / Table in the command line environment.
Upvotes: 1
Views: 3394
Reputation: 1909
DESCRIBE is an alias for SHOW COLUMNS, like a shortcut. If you want all the other stuff then you need to use SHOW commands for your stuff. And SHOW COLUMNS for the rest.
Upvotes: 1
Reputation: 63616
Just dump the database without data using
mysqldump --no-data (other options)
As if you were taking a backup. Use the same options as you do when taking a backup (maybe --lock-tables=0 - you don't need a lock when dumping the schema)
Without the data, you get just the schema which includes all those things you said above.
Upvotes: 3