Saturday 21 April 2018

get all Create table scripts from Database


mysqldump --no-data --user=USERNAME --password=PASSWORD --host=HOST DATABASE_NAME TABLE_NAME

Example:
If you want the entire database, just remove TABLE_NAME:
in below statement transport is DATABASE_NAME, it fetches all table create statements.

$ mysqldump --no-data --user=root --password=password --host=localhost transport > sql.txt

No comments:

Post a Comment