View All Table / Database Constraints in MySQL
How do you view all the constraints (Primary keys, Secondary key开发者_如何学Cs, Assertions , Triggers, etc) in a MySQL Database / Table in the command line environment.
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.
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.
Describe
Show
精彩评论