mysql -e 'SHOW CREATE TABLE users;' mydb

Category: Databases & SQL

mysql -e 'SHOW CREATE TABLE users;' mydb

Show the exact CREATE TABLE statement

Prints the DDL that defines users, including indexes, constraints, and table options — useful for replicating a table elsewhere. Related: mysqldump --no-data exports it with surrounding statements.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.